March 12th, 2008

No activity within 1800 seconds; please log in again

PHP, by Donncha.

1800 seconds is such a long time, right?

  1. It’s 30 minutes.
  2. It’s 0.5 hours.
  3. It’s 0.0208333333 days.
  4. 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.

You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!

Back Top

Responses to “No activity within 1800 seconds; please log in again”

  1. Very nice! It is always annoying when you go back to a tab and have to login again.

  2. thanks! this crap was annoying me for weeks

  3. This always drove me nuts! tbh.. I never looked into changing the timeout.

  4. 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.

  5. Thanks

  6. Fantastic, I was finding that I was thrown off after just a few seconds, this mod fixed that for me. Thanks.

    Richard Bagnall at September 18, 2008 2:15 pm
  7. 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.

  8. 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!

  9. 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)

  10. Thx, this is very useful info for me.

    Sebastian Field at April 16, 2009 9:20 am
  11. 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.

  12. it is a cookie issue

  13. 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

  14. Great – thanks for posting this.

  1. Sebastian Field Blog » phpMyAdmin, 1800 секунд, это много или мало? (,April 16, 2009)

    [...] вот эту замечательную статью от Donncha O [...]

Leave a Reply

Back Top


Holy Shmoly! is Digg proof thanks to caching by WP Super Cache