Article Diary - General Knowledge Digest

How can I change session timeout value?

Check the following values in your php settings.

  1. session.cookie_lifetime
    - session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser.
    - a value of 0 means "until the browser is closed"
  2. session.gc_maxlifetime
    - session.gc_maxlifetime specifies the number of seconds after which data will be seen as ’garbage’ and cleaned up.
    - garbage collection occurs during session start.

Try to set session.gc_maxlifetime to 7200. You must restart your server for this to take effect.

5 (1)
Article Rating (1 Votes)
Rate this article
Attached Files
There are no attachments for this article.
Comments (1)
Comment by James on Tue, Apr 27th, 2010 at 3:38 PM
Thanks for the information. I was desperately looking for the variables that control session expiry i.e. session timeout value in php.ini file.
Security Code Security Code
Related Articles RSS Feed
Advanced Backup System - PHP Backup Script
Viewed 1308 times since Wed, Jul 28, 2010
What is rel="nofollow" attribute?
Viewed 954 times since Thu, May 13, 2010
PHP Quiz Questions and Answers
Viewed 4074 times since Mon, Jan 11, 2010
30 High Quality Charts & Graphs for Web Developers
Viewed 3256 times since Wed, Mar 23, 2011
Inline Form Validation With jQuery
Viewed 1493 times since Sat, Jan 9, 2010
ValidForm Builder - Creating Forms With Validation
Viewed 1108 times since Wed, Apr 21, 2010
Open Source WYSIWYG Editor
Viewed 1449 times since Thu, Jan 7, 2010
10 Tips for Writing Better CSS Code
Viewed 1329 times since Fri, Nov 27, 2009
Use PHP Functions In JavaScript with PHP.JS Library
Viewed 1033 times since Fri, Jan 8, 2010
CSS Positioning - Absolute, Relative & Fixed
Viewed 1513 times since Thu, Dec 3, 2009