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
How to protect specific folder or disable directory browsing using htaccess?
Viewed 6376 times since Sun, Mar 14, 2010
imgAreaSelect - jQuery Plugin To Select Areas On Images
Viewed 1606 times since Thu, Dec 31, 2009
SlideDeck - Cool jQuery Slideshow Plugin
Viewed 1330 times since Thu, Feb 4, 2010
Create Glowing, Radioactive Buttons with CSS
Viewed 1261 times since Sun, Dec 27, 2009
10 AJAX based PHP WebMail Clients
Viewed 1903 times since Mon, Jul 26, 2010
13 Useful Javascript Syntax Highlighting Scripts
Viewed 1657 times since Mon, Jan 4, 2010
Making A Basic PHP Template System
Viewed 1219 times since Tue, Dec 8, 2009
Create A Page Peel Effect With CSS & jQuery
Viewed 1221 times since Tue, Jan 5, 2010
Modify HTTP Headers in PHP with Examples
Viewed 1275 times since Wed, Mar 10, 2010