Session Expiry

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
eskio
Forum Commoner
Posts: 66
Joined: Tue Apr 01, 2008 1:00 am

Session Expiry

Post by eskio »

Hi,

I designed a page using sessions. For security purpose, I want that when the user leaves the page for example 5 minutes, I want the session to expire. I want to know if there is a way to know when the page is idle for a certain amount of time?

Thanks.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Session Expiry

Post by jaoudestudios »

store the unix timestamp in another session and check this with the current time stamp

use...

Code: Select all

time()
eskio
Forum Commoner
Posts: 66
Joined: Tue Apr 01, 2008 1:00 am

Re: Session Expiry

Post by eskio »

Thanks
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

Re: Session Expiry

Post by devendra-m »

or you can set session.gc_maxlifetime =300 in php.ini
Post Reply