开发者

how to create a unique folder for each client

One browser means one client but what if two browser from same machine?

I think it should be considered as one client because I see the similar session id for any no. of browser. Anyway keeping these things in mind, I have an issue.

A client send file and server's application create a unique folder in context to save file.

unique folder : it is auto created & for each client.

so my question is, is session id perfect solution for unique folder name ??

@Edit :开发者_StackOverflow社区 An application upload multiple files in a auto-created folder from client to server and provide a link to download the same folder to same client.once the client downloads the folder(all files), it is removed otherwise remains for next couple of hours(programmed).

what if there are many clients uploading the file, then how should I avoid the duplicate folder name? So I thought to autocreate folder on the basis of session-id


Using the session id will give you one folder per session.

How the client relates to sessions depends on several things: usually, different browsers (ff, ie, etc) do not share sessions, so each new browser will have it's own session with your server - irrespective of the machine on which the browser is running. If the user opens multiple windows using the same browser, they will share the same session if using cookies, but have different sessions if the sessionId is embedded in the url.

Edit: if the sessionId is in the URL, you can in fact get any browser on any machine to share the same session by copying the URL, with the sessionId, into the browser.


Yes session id seems to be fine.

Session_id can indeed be duplicated, but the probability is very low. If you have a website with a fair traffic, it may happens once in you web site life, and will just annoy one user for one session.

This is not worth to care about unless you expect to build a very high traffic website or a service for the bank industry.

-> How unique is the php session id


don't you have an authentication system? if users get logged in, user id is the one you need to use. so, even if two different users logged in from the same machine, they will have two seperate folders. if you don't require authentication, maybe you can force to get a new session id for the first connection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜