Manually set PHP Session Timeout
Sometimes it is necessary to set the default timeout period for PHP. To find out what the default (file-based-sessions) session timeout value on the server is you can view it through a ini_get command:
// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get(’session.gc_maxlifetime’);
Change the Session Timeout Value
// Change the session timeout value to 30 minutes
ini_set(’session.gc_maxlifetime’, 30*60);
If you have changed the sessions to be placed inside a Database occasionally implementations will specify the expiry manually. You may need to check through the session management class and see if it is getting the session timeout value from the ini configuration or through a method parameter (with default). It may require a little hunting about.
There are more settings for you to manage your session with, have a look on the PHP site.






Very good function.To day my network is very slow so i can open my web because default session time out =30 seconds.
Thank for ur post this article.
Comment by Nguyen Duc Manh — December 15, 2007 @ 1:08 am