Change php.ini to increase duration of session

For Ubuntu Server php.ini is located at /etc/php5/apache2/php.ini

sudo nano /etc/phpX/apache2/php.ini

Simply change the default value of 1440 to your desired value for session.gc_maxlifetime increase duration of session

#session.gc_maxlifetime = 1440
session.gc_maxlifetime = 7200

Restart apache service to apply change

sudo service apache2 restart

You could verify by calling below page

echo ini_get("session.gc_maxlifetime");

Leave a Comment

Your email address will not be published. Required fields are marked *