Page 1 of 1
Unique Session ID's
Posted: Tue Jul 02, 2002 6:11 pm
by Galahad
Is there a way to get a browser window id or something to use as a session id? I want to have multiply sessions open at once, so I figure giving each session a unique id for it's window would work.
As far as I can tell, if I don't give it any id, multiple windows' sessions can conflict. If I have a window open with sessions going, then open another window, it sees the other window's session, doesn't create a new session, and tries to use the other window's session. Does anyone have any ideas? Thanks for the help.
Posted: Tue Jul 02, 2002 6:27 pm
by protokol
Just curious, but what is your reason for needing multiple session id's. We may be able to help you find a better solution to your problem
Posted: Wed Jul 03, 2002 10:44 am
by Galahad
I am making a page that allows you to view/edit info from a mysql database. I would like to allow users to have multiple windows open at a time, working on different records. Also, another page (not written by me) is very likely to be open at the same time that also uses sessions.
I realized that I could pass a session id with get. Aside from an unsightly url, is there any reason not to do this? Thanks for the help.
Posted: Wed Jul 03, 2002 10:48 am
by protokol
Well, the main purpose of sessions is to allow users to save state between web pages. This means that you can have as many session variables used as you want.
More than one session id per user is definitely not needed. If you want to allow them to edit different records, then let them edit different records. The session id is simply saying that all of these variables that are used can be accessed from every page.
A session id should only correspond to one user. More than one session id really wouldn't make much sense.
Posted: Wed Jul 03, 2002 11:42 am
by Galahad
I understand the purpose of sessions. Here is what I am working on: I have created a admin page for a mysql user database. The idea is that an admin can come, login to edit info for a specific user, make their changes or whatever, and logout. The problem arises if the admin logs in, decides they want to work on a different user at the same time. If they open a new window and log in again (with the original window still open).
As far as I can tell, the second page sees that a session already exists and simple uses that session. This prevents each session (They are session variables, not user variables. There is plenty of reason to have multiple sessions open at once.) from having unique usernames or whatever.
Am I way off here? My testing (yes, I've tried this several times) and manual reading leads me to believe that this is how multiple pages using sessions interact. Is this really how it work? If not, could someone explain it in more detail?