Tag Archive | "session id"

Php Sessions. Need Some Help.?


Hello, I am writing a simple web site. I successfully made the register and log in pages, but now I want to allow only one session per username.
More detailed: When someone logs in a session starts.
If he tries to log in from somewhere else, I want the first session to drop before starting a new session.
How can I do that?
-I already thought of keeping the session ID in the database and change it when the user logs in from another computer. When he tries to go back to the first computer and clicks any link, it checks automatically if the session_id that it has is different compared to the one saved on the database. If it is, it automatically logs out. I could add timed sessions so if the user does not come back to his first computer it automatically closes the session etc.
Problem is that even if I do that, the server will be loaded with sessions that will never be used again until the sessions get timed out. Is there any way to close the session (lets say close a session by knowing its id)?
Any other ideas?

Posted in Affiliate Marketing 101Comments (0)


Archives

Powered by Yahoo! Answers