session expiratoin

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
murlopaz
Forum Commoner
Posts: 60
Joined: Wed Oct 11, 2006 5:02 pm
Location: Baltimore, MD, USA

session expiratoin

Post by murlopaz »

Hi everybody. I have a login page based on cookie sessions.
Right now the cookie is set to expire in 5 minutes...
I want it to expire after 5 minutes of user inactivity.
How can I achieve that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Store the "current" time in the session data. Compare it with the request time. If greater than the allotment, killed it.
Post Reply