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,

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.