My app need to save some files to a temp folder, maybe pack them into a zip later. The folder need to be session specific: each session should have their own folder to avoid interference.
Right now I create a timestamped folder in server function, so it should be session specific if no user connect to server at same second. I can reduce the possibility by further including fractional seconds, but I'm wondering if there is a better method.
I looked at Session
object but not sure about it. Is there any session specific information I can use, like some token or hash value?
I also thought about a random hash per session. If hosted by a server, is it possible for multiple worker's random number generator generate same number (random number is tricky in parallel environment)?