session variables and multiple users

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Zooter
Forum Commoner
Posts: 45
Joined: Tue May 18, 2004 10:46 am
Location: South Africa

session variables and multiple users

Post by Zooter »

Never even though about it up until now...

How do session variables handle multiple users? If I write server side scripts that put a username into a session variable called user, what happens if more users also log into the website. Now there will hopefully be as many username session variables wth the same name "username" and with different values, or will there only be one session variable with the latest value?

How do I handle multiple users and therefore multiple sessions?

Thanks
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

You don't handle anything - each user will be assigned a unique session ID upon which all variables will be stored.

Think how pointless sessions would be if they didn't work like this :)
Zooter
Forum Commoner
Posts: 45
Joined: Tue May 18, 2004 10:46 am
Location: South Africa

Post by Zooter »

Thanks.
Post Reply