1800 seconds is such a long time, right?
- It’s 30 minutes.
- It’s 0.5 hours.
- It’s 0.0208333333 days.
- It’s also 5.70397764 × 10-5 years.
And it’s not long enough for me. phpMyAdmin logs you out after 1800 seconds, obviously for security reasons. That’s fine if there are other people about, if I was in an office with people coming and going, but I work from home. All I see for most of the day is my family, the radio, my messy desk, computers, and the view out the window. Time to figure out how to make that 1800 second limit a little longer or remove it altogether.
After a little digging, I discovered that extending the time limit to a day is actually quite easy. Open your phpMyAdmin’s config.inc.php and search for or add the following line:
$cfg['LoginCookieValidity'] = 86400;
Refresh your logged out phpMyAdmin and presuming you haven’t left it idle for 24 hours, you’ll be logged in again!
If the time limit really bugs you, you need http authentication. Look for the “auth_type” line in the config.inc.php and change that to “http”. phpMyAdmin won’t log you out as long as your browser is open. Perfect!
If you’re concerned about sending your MySQL username and password in the clear each time you make a request to phpMyAdmin you can either use SSL or try the “config” auth_type. Make sure you fill in the username and password fields in the config file, and secure the phpMyAdmin directory with a htpasswd file.

20 Comments
Georgie (3 comments.) on March 12, 2008 at 5:10 pm.
Very nice! It is always annoying when you go back to a tab and have to login again.
someguy on March 20, 2008 at 10:41 am.
thanks! this crap was annoying me for weeks
Jason Roe (4 comments.) on March 23, 2008 at 11:37 am.
This always drove me nuts! tbh.. I never looked into changing the timeout.
Luo Ge on June 7, 2008 at 12:18 pm.
I changed the config.inc.php file as laid out above, but it still logs me out when I least expect it. The only difference it made was that it no longer gives the reason as being that I was inactive for 1800 seconds. It gives no reason at all. There must be some other setting somewhere that also sets a time limit.
vaasu on July 16, 2008 at 8:14 am.
Thanks
Richard Bagnall on September 18, 2008 at 2:15 pm.
Fantastic, I was finding that I was thrown off after just a few seconds, this mod fixed that for me. Thanks.
koyama on November 19, 2008 at 1:33 am.
Great tip, but it seems to be working only on some systems. On my Linux machine it seems to be working, but on my Windows Server 2003 it is not working.
koyama on November 19, 2008 at 2:03 am.
Sorry, it is working anyway also on Windows Server 2003, I had been adjusting the time settings to 1 year ahead because I was testing some other script. Of course, phpMyAdmin throws me off.
Stooopid me!! Thanks for the tip once again!
James on February 11, 2009 at 2:20 pm.
I found you need to clear the relevant cookies too, and make sure you go to the site fresh (without any ?token=B6D5BC… junk on the end)
Sebastian Field (1 comments.) on April 16, 2009 at 9:20 am.
Thx, this is very useful info for me.
Pingback: Sebastian Field Blog » phpMyAdmin, 1800 Ñекунд, Ñто много или мало?
James (1 comments.) on May 23, 2009 at 9:09 am.
Thanks so much, I swear it feels like I have logged in over a hundred times today, nothing more annoying than practicing your password typing skills every 30 minutes to reference table structures.
JP on July 27, 2009 at 11:30 pm.
it is a cookie issue
JP on July 27, 2009 at 11:32 pm.
clear your browser cache including cookies and you will find that you are not hampered with this problem and don’t have to make modifications to your config file
TMG on January 7, 2010 at 8:58 pm.
Great – thanks for posting this.
satih on June 25, 2010 at 1:48 pm.
change your session.gc_maxlifetime in php.ini too, otherwise it may not work
Annamalai on December 8, 2011 at 4:54 am.
Thanks lot
long time i faced this issue
Dallas Bluth (2 comments.) on January 24, 2012 at 7:24 pm.
Thanks man! I’d been living with that limitation for waaaay to long!
Dallas Bluth (2 comments.) on January 24, 2012 at 7:31 pm.
Also had to update the line “session.gc_maxlifetime = 86400″ in php.ini but working great now!
jake (1 comments.) on February 11, 2012 at 10:13 pm.
And what if I use XAMPP – I can’t find this line anywhere.