How to set my phpmyadmin user session to not time out so quickly? [duplicate]
Asked Answered
B

2

209

I work on my wamp for localhost backend development everyday.

I feel annoyed by phpmyadmin auto log out out quickly. Is there any way I could get rid of this or extend the timeout?

Where can I set this timeout value?

Beaman answered 19/9, 2013 at 5:23 Comment(0)
A
296

To increase the phpMyAdmin Session Timeout, open config.inc.php in the root phpMyAdmin directory and add this setting (anywhere).

$cfg['LoginCookieValidity'] = <your_new_timeout>;

Where <your_new_timeout> is some number larger than 1800.

Note:

Always keep on mind that a short cookie lifetime is all well and good for the development server. So do not do this on your production server.

Abercrombie answered 19/9, 2013 at 5:32 Comment(17)
The UI says that user settings (such as the session timeout) will only be saved for the current session unless the permanent phpMyAdmin configuration storage is properly configured (which is probably not the case for a default WAMP installation). If this is true, setting the timeout in the config.inc.php might be better.Attendance
In ubuntu, config.inc.php is accessed fast and easy by sudo gedit /etc/phpmyadmin/config.inc.phpSwallowtail
I found that I also needed to add the following line to the config.inc.php file: ini_set('session.gc_maxlifetime', <your_new_timeout>); And, I'm pretty sure the two values need to be equivalent. BTW: [on my distro, at least] the config.inc.php file is in /etc/phpmyadmin/.Phillisphilly
whatever you do, don't set it to 0 thinking that means never, it will actually instantly log you out once you log in....Mirza
An anonymous user suggests: "just comment the //$cfg['Servers'][$i]['auth_type'] = 'cookie'; in your config.ini file"Mastership
@dangel If you used the UI to set your timeout preference, any configuration you have in config.inc.php seems to be overridden. So, if you do happen to lock yourself out by setting timeout to 1, you can comment out $cfg [‘Servers’][$i][‘auth_type’] = 'cookie'; and replace it with $cfg['Servers'][$i]['auth_type'] = 'http';Chambertin
make sure to modify session.gc_maxlifetime also otherwise you'll get a " Your PHP parameter session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin."Verticillaster
@subedi-kishor another thing to mention is session.gc_maxlifetime, which has to be the same as LoginCookieValidity, otherwise the smaller value will be the actual value.Mcmichael
This answer is not working for me as of December 2018, might be deprecatedMendelssohn
There are two files. /usr/share/phpMyAdmin/setup/frames/config.inc.php and /usr/share/phpMyAdmin/test/test_data/config.inc.php In the first file, I see no $cfg variable already declared. How does this solution work? In the test version of the file (2nd file), I do see the $cfg variable. Is test really the correct place to configure production phpmyadmin?Supplement
Every config in the test file is in this format $cfg['Servers'][$i]['auth_type'] = 'cookie';. Should we instead of $cfg['LoginCookieValidity'] = <your_new_timeout>; be typing in $cfg['Servers'][$i]['LoginCookieValidity'] = 12345;? `Supplement
I'm sure that's the case, ahn, but anyway, note that the answer says to add the cfg option. It does not already exist... for some reason.Nth
How do you find config.inc.php? my etc/phpmyadmin folder is empty. On ec2Breslau
For Ubuntu 18.04 the file is /usr/share/phpmyadmin/libraries/config.default.phpSidereal
@AhmedIsmail Right at the beginning of /usr/share/phpmyadmin/libraries/config.default.php there is a big warning saying DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!!Bakke
Please keep in mind the newer versions of xampp bitnami, this param is already set there with a value of 1440, just you need to update and add your own timeout there!Kailyard
You can and should set session.gc_maxlifetime in the config too. Probably best to add something like: ini_set('session.gc_maxlifetime', $cfg['LoginCookieValidity']);Sodomy
C
262

Once you're logged into phpmyadmin look on the top navigation for "Settings" and click that then:

"Features" >

...and you'll find "Login cookie validity" which is typically set to 1440.

Unfortunately changing it through the UI means that the changes don't persist between logins.

Cameo answered 16/1, 2014 at 14:27 Comment(14)
I sometimes wonder why they still bother making user interfaces, it seems like everyone still uses the command line and ini files for configuring their work environment...Blatant
Way easier solution, this should be the accepted answer.Concession
This only works if you keep logging in -- as noted above, modifications to config.inc.php will persist between logins.Maddening
On Ubuntu I need to change my global php.ini (/etc/apache2/php.ini) session.gc_maxlifetime value, because otherwise phpmyadmin can't use own settings. I think this apply to any OS.Intern
Note that you can't set a value greater than 9223372036854775806 or it will result in a integer overflow.Jeanmariejeanna
@LittleFinger - I'm sure you're correct, but that's hilarious. I'll give you a dollar if phpMyAdmin is still around in 300 million years and your login is still active. :)Zacharyzacherie
Server:localhost -> Settings -> Features -> General -> Login cookie validityElkeelkhound
@Zacharyzacherie come on be generous to LittleFinger. Put the dollar in a savings account, and given today's typical interest rates, in 300 million years, it could be worth... 2 dollars!Onfroi
This is the correct answer; does not require any file configuration.Filmy
On WampServer this option gets reset as soon as it restarts. Need to actually change the PHPMyAdmin config file for it to stick.Probe
must be the accepted answerMuscolo
According to PHPMyAdmin changing this in the UI "will be saved for current session only." It's better to alter the config.inc.php as the other answer suggests.Szczecin
how can I activate this setting? It is not available on the UI of the phpmyadmin 4.8.4.Concentrated
This feature no longer available in the GUI (verified as of phpMyAdmin 5.x) You'll need to do 2 things, add the line to config.inc.php i.e. $cfg['LoginCookieValidity'] = 3000; Then update your php.ini and make sure that value is >= session.gc_maxlifetime = 3000 then restart httpd and reload pageDurfee

© 2022 - 2024 — McMap. All rights reserved.