Confused about sessions
Posted: Wed Nov 24, 2004 3:05 pm
A while ago, I made a user login system for a site of mine. It was my first attempt at something like that in php, and not surprisingly, it didn't work properly!
I was using sessions for the users, and that's where I think the problems came from. When a user logged in, they logged in fine, then, when they went to another page, they were logged in as one of the other users! This was a really weird problem. I then switched over to using cookies instead, and it all worked perfectly (so it wasn't too much of a failure!).
I think part of the problem comes from my own confusion about sessions. This time round, I'd like to send the session id from one page to another using the SID value appended to the url. Once I've done that, how do I then access that session id on the next page that the user goes to and tell the script to use that session? Or is it done automatically?
any help would be greatly appreciated!
K
I was using sessions for the users, and that's where I think the problems came from. When a user logged in, they logged in fine, then, when they went to another page, they were logged in as one of the other users! This was a really weird problem. I then switched over to using cookies instead, and it all worked perfectly (so it wasn't too much of a failure!).
I think part of the problem comes from my own confusion about sessions. This time round, I'd like to send the session id from one page to another using the SID value appended to the url. Once I've done that, how do I then access that session id on the next page that the user goes to and tell the script to use that session? Or is it done automatically?
any help would be greatly appreciated!
K