29755

Upping the default timeout for a PHP application

Question:

I have a PHP application (<a href="http://en.wikipedia.org/wiki/GLPI" rel="nofollow">GLPI</a>) running on Apache. What is the default session timeout and how do I change it?

Answer1:

The default session time is 1440 seconds (24 minutes).

And you can change it through the configuration files php.ini or .htaccess.

Using php.ini,

session.gc_maxlifetime = 2000;

Using .htaccess,

ini_set( 'session.gc_maxlifetime' , 2000);

Answer2:

You can extend the session timeout to 5 minutes by

ini_set('session.gc_maxlifetime', 5*60);

You can check default session timeout by

echo $default = ini_get('session.gc_maxlifetime');

Recommend

  • Calculate time difference in hh:mm:ss with simple javascript/jquery
  • Filter strings with regex before casting to numeric
  • Center align outputs in ipython notebook
  • Cannot upload to OneDrive using the new SDK
  • Is it possible to open regedit and navigate to straight to a specific key using process.start?
  • Diff between two dataframes in pandas
  • Parse a date string in a specific locale (not timezone!)
  • How can I extract results of aggregate queries in slick?
  • Marklogic : Query response time is very high
  • How to get Eclipse Oxygen to run on Java 9
  • print() is showing quotation marks in results
  • Chrome doesn't support silverlight anymore? How to solve this?
  • Syntax for setting draggablecursor property in google maps api
  • Q promise. Difference between .when and .then
  • Paperclip, set path outside of rails root folder
  • Debugging ASP.NET on a built-in web server suddenly stops
  • Illegal mix of collations for operation for date/time comparison
  • Ajax jQuery multiple calls at the same time - long wait for answer and not able to cancel
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Spray.io: When (not) to use non-blocking route handling?
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Modifying destination and filename of gulp-svg-sprite
  • Hazelcast - OperationTimeoutException
  • Do I've to free mysql result after storing it?
  • GridView Sorting works once only
  • Calling of Constructors in a Java
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • retrieve vertices with no linked edge in arangodb
  • File upload with ng-file-upload throwing error
  • A cron job substitute?
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • How to include full .NET prerequisite for Wix Burn installer
  • json Serialization in asp
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • Is it possible to post an object from jquery to bottle.py?
  • How to get NHibernate ISession to cache entity not retrieved by primary key