Hi,
How would I destroy/end a visitor's session after a particular period?
And, how would I make their session last longer than the default 1440?
Thanks.
Session handling
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
You can use session_destroy() to remove user session i.e. when he clicks LOGOUT button.
php kills session automatically after some time.
You can define it in php.ini:
session.gc_maxlifetime
php kills session automatically after some time.
You can define it in php.ini:
session.gc_maxlifetime
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
This should work (on top of the page before you start a session):
Code: Select all
ini_set('session.gc_maxlifetime', 60);There are some other issues with changing session timeout
check this website out http://www.captain.at/howto-php-sessions.php
check this website out http://www.captain.at/howto-php-sessions.php