Wednesday, March 28, 2012

how to fix : No activity within 1800 seconds; please log in again

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.

2 comments:

  1. Great article, thank you very much.

    ReplyDelete
  2. Well, I have added the line with $cfg['LoginCookieValidity'] = 86400; to my /etc/phpmyadmin/config.inc.php and I don't get the message "No activity within 1800 seconds; please log in again" but I still get logged out. What would be going on, any idea?

    ReplyDelete