Jump to content

log out a user session


tmyonline

Recommended Posts

javascript... just, no.  :o

 

 

sessions have time limits im sure of it, if you mean user session by "cookie and mysql tables", then add in the sql table "last_moved", then whenever the user loads/reads/edits a page then put the current unix timestamp into that field.

 

then just check the field + 30 minutes is less than or equal to the current time; if it is then log the user out (remove cookies or w/e).

 

 

hope this helps,

Session garbage collection is not meant to end sessions. It is solely for the purpose of deleting session data files that have not been recently accessed. Using GC for any other purpose will cripple the session functionality for any thing else you want to use it for on your site.

 

Garbage collection is only checked on session_start() and it runs randomly based on the session.gc_probability and session.gc_divisor settings.

 

To automatically log anyone out, you must store their last time of activity and then check on each new activity if the last time is farther in the past then allowed.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.