my login script checks for login name and password in the database, if true then set value for a session variable for example $_SESSION = $login --> this is to identify who got logged in.

however, if i have more than one user logged in to the system, then $_SESSION will get over written .. only the last user logged in session remains.

how am i supposed to have multiple users logged in at the same time with session?

is this possible with session? or if cookies have to be used.

thanks

Member Avatar for Zagga

Hi k2k,

When each user logs in they start a new, individual session that is unique to them. It is not connected to any other sessions.

Session variables are only global inside the session so you can't override them from another session. The only time you may have problems is if every user is using the same pc at the same time.


Hope this helps
Zagga

The session variables could only become the same if you are setting them from some common place / value (e.g. a single field set in a database).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.