I would like to ask how can let many users login with the same computer with different session? as there is session to get the unique userid, now is one user for one session login.
How to allow multiple users login on one computer with different session?
How are these people all meant to log in at the same time on the same computer? Most computers I have seen only have one keyboard, one mouse, etc... That is the only time you would run into this problem.
They may have use different browsers, i.e IE 7, FireFox, Opera, Safari and so on Otherwise, the session will lose its characteristics, for which, it was invented.
If the same person logs on with a different browser on one machine, it will register a new and very different session. But what possible setup in the world would see several users on the same machine using different browsers connecting to your web-based system?
sorry, the question should be let multiple users login to the system with the same browser on one computer which located in internet cafe. as the cookie stores info for a period of time.
I think only me here understand you question...
Ok, to save session, the server need the browser to save the informations of the current user in cookies.
Every user connected to your website has a cookie in his PC that save his session, and every time the user load a new page, the browser send the informations of that user, and then the server uses these informations to show the page related to that exact user.
For example this forum, phpbuilder.
When I'm now connected, I have a cookie here whith my id, it can be "Ilyes" or a number. When I load the page, my browser send "Ilyes" to phpbuilder, so php builder display my name and my other information on top of the page
If I disable cookies in my browser, I can't no more login to phpbuilder.
I hope that answer your question
By default, the session will timeout fairly quickly, so that someone else coming onto the computer and visiting your site will get a new session. Try logging in to your site, closing the browser for 5 mins, and then going back onto it, and you'll see what I mean.
On an aside, sessions can be set up for two types of use: cookies or URLs. I'd recommend cookies, as they don't clutter the URL up. The cookie itself will just store the session ID, it does not store any of the data you put into the $_SESSION variable.
If you are having problems like this, try reducing the time delay before a session will time out due to inactivity. Be careful though, as this will cause someone who stays on a page for too long as inactive, and they'll have to log in again.