Bikram Pahi
Bikram Pahi

Reputation: 1183

PHPMyAdmin automatic session destroy issue

I am using Ubuntu server with LAMP and I installed phpMyadmin to manage database. By default phpmyadmin session is destroying after 1440 sec.

I have gone through different online tutorials and forums but no method works.

Upvotes: 0

Views: 299

Answers (1)

Isaac Bennetch
Isaac Bennetch

Reputation: 12442

According to the documentation:

  • Edit the phpMyAdmin config.inc.php and add (or edit) the $cfg['LoginCookieValidity'] directive, for instance $cfg['LoginCookieValidity'] = 10080
  • Edit the PHP configuration file php.ini (making sure to edit the correct one; you can use phpinfo() to locate the correct location) and extend the time for session.gc_maxlifetime to at least the same value you used for LoginCookieValidity.

EDIT

You don't want to change the session.gc_maxlifetime for all of your applications, but there's still hope. Since you are using Apache and if the corresponding <Directory> entry in your Apache configuration contains AllowOverride Options (or AllowOverride All), then you should be able to configure this on a per-application basis to only affect phpMyAdmin.

You'll need to create a .htaccess file in the top level of the phpMyAdmin directory and include a line like:

php_value session.gc_maxlifetime 10080

That will force the modified setting only for that folder (and subdirectories), so as long as it's in your phpMyAdmin folder it will only affect the phpMyAdmin application.

If you prefer, you should be able to create (or modify) an Apache vhost and edit the PHP setting directly in the Apache configuration; the configuration directive would be exactly the same,

php_value session.gc_maxlifetime 10080

These methods will only work if the AllowOverride directive is set to either All or Options; lesser settings such as None will not allow these changes.

More details.

Upvotes: 1

Related Questions