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.
3 Answers
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.
in the config.inc.php file, which should be located in your phpadmin root folder, add this setting:
$cfg['LoginCookieValidity'] = 14400;
14400 is the number of seconds before timeout; 14400 is 4 hours. Of course, you can use whatever interval you like.
1Based on your question, it sounds like you changed it through the Settings tab within phpMyAdmin. If you have the phpMyAdmin Configuration Storage configured, that setting is stored there, if not it's just stored in your browser session so accessing from another browser or expiring that session/removing the cookie should do it. If it's in the phpMyAdmin Configuration Storage database you've got two means to get around it.
- Disable the database. Edit
config.inc.phpand temporary comment out the line about$cfg['Servers'][$i]['userconfig']. Log in, open the phpMyAdmin database (by default probably calledphpmyadmin) and edit the userconfig table (by defaultpma__userconfig). You can click to edit the corresponding value in theconfig_datacolumn or just delete that row entirely to reset all your preferences. - Log in from the command line (or any other MySQL administrative tool), open the phpMyAdmin database (by default probably called
phpmyadmin) and edit the userconfig table (by defaultpma__userconfig). You can edit the corresponding value in theconfig_datacolumn or just delete that row entirely to reset all your preferences. This will require a bit of SQL ability (not a whole lot), so probably the first method is easier unless you're comfortable with the MySQL command line interface.
The standard disclaimers about backing up first apply, of course.