0

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 : 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

LOZ
  • 1,169
  • 2
  • 16
  • 43
  • The functional reqiurement is too vague and this question is unanswerable until you clarify this. I can at least tell that the session ID is unique per the **current** browser session. If the same client opens a different make browser (e.g. Chrome, Firefox, and/or MSIE, etc) on the same machine, it gets a different session ID. Also, if you close and reopen the same browser, the session ID changes. Also, if you don't visit the website for more than 30 minutes and then revisit it, the session ID changes. It's not a good **permanent** solution while you seem to be looking for a permanent solution – BalusC Oct 09 '11 at 03:27
  • @BalusC thanks BaluC, please take a look again. as i have modified my question. –  Oct 10 '11 at 06:23

3 Answers3

1

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.

andypandy
  • 1,117
  • 7
  • 9
0

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

Community
  • 1
  • 1
Tobias
  • 9,170
  • 3
  • 24
  • 30
0

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.

Emir Akaydın
  • 5,708
  • 1
  • 29
  • 57
  • yes, it's good to use user id but this application can be use bu unauthorized user too. i think `getting new session id` is great sol'n. –  Oct 07 '11 at 10:13