Who is online php sessions mysql
Hi all,
Once again I have another problem...
I have an admin section on my site where users can create quotes etc.
I want to be able to only allow one of the two people who have permission to access the section to be logged on at any one time.
Similar to how this forum tells you who is and who isnt online etc.
At the moment, the idea I have is to use a table in mysql to store who is logged in.
If it is user 1, then when user 2 tries to log in, it would simply display a message.
However, it is easy to add user1 to the db when they log on, but how do i then remove them when they log out, assuming they close the window rather than click the "log off" button.
Make sense?
Please help me - I have never used cookies, and have basic experience with sessions, so please explain in a simplified manner.
THANK YOU!
Darren.
|