0

I have a login page that uses session variables. How can i set an expire time for a session? eg: after 15 minutes of inactivity destroy the session.

how can i do it?

LiveEn
  • 3,193
  • 12
  • 59
  • 104
  • 2
    possible duplicate of [How do I expire a PHP session after 30 minutes?](http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes) – Artefacto Jun 09 '10 at 03:54

1 Answers1

0

You must set a variable in your session object with the time in every page it accesses, and in that all pages you will calculate if the current time have a difference from the last time setted of 15 minutes or more, if so you invalidate the session...

if not, you set a new time to that variable..

Garis M Suero
  • 7,974
  • 7
  • 45
  • 68