How to manually set phpMyAdmin login cookie validity time

phpmyadmin

Solution

In your `config.inc.php` file set both the login cookie validity and the session max lifetime so that you won't get the following warning:

Your PHP parameter session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin, because of this, your login might expire sooner than configured in phpMyAdmin.

So put this in your `config.inc.php` file and you'll be fine (change the time accordingly to your neeeds):

$sessionValidity = 3600 * 24 * 365; // one year

$cfg['LoginCookieValidity'] = $sessionValidity;
ini_set('session.gc_maxlifetime', $sessionValidity);

Check also in your database, it may be worth temporarily disabling it so that the settings there do not override the ones in the `config.inc.php` file.

Problem

In phpMyAdmin I set the 'login cookie validity' to 1sec. As one can imagine, it now throws me out after 1 second of logging in. I can't change it back in phpMyAdmin fast enough so I need a manual alternative. I don't want to reinstall phpMyAdmin as I will loose all of my databases. I also can't stay logged in long enough to export them. Is there a way to do this manually? I've tried setting the `session.gc_maxlifetime` to `86400` in my `php.ini` file but it did nothing.

Original source

Related problems