View Single Post
Old Jun 5th, 2005, 7:43 AM   #3
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Actually the problem I believe is that once the user leaves the site there is no code being executed at the request of the user which means the value in the database just remains as '1'.

There are two ways you can go about doing this... when the user logs in, and everytime the request a page update the session in the database with a timestamp that represents there last access... if soo much time has elapsed since last timestamp force them to log in again, this however will not remove the '1' from the database, but in all reality it would not matter since you could control and prevent the session from going stale anyway.

If you wanted to actually reset the '1' to '0' or manually destroy other data what you will need to do is run a backend script through a cron job or as a process which sleeps for so much time and than checks all the session timestamps in the database, anything that has timeout is immediatly reset and destroyed.
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote