User login

Stop phpMyAdmin from logging you out in your own local environment (Ubuntu)

Searched words: 
stop timeout extend php my admin session timeout expire session value login cookie validity ubuntu phpmyadmin remove timeout

vi /etc/phpmyadmin/config.inc.php

You may need to use sudo; vim will warn you if you try editing a read-only file.

Edit an existing LoginCookieValidity setting if any, or (as in our case) add the following to the bottom of the file.

(Note that in vim you can search with /LoginCookieValidity and, if finding nothing, go to the end of the file with :999 -- actually that's go to line 999 which is just as good in this case, there's a command to do it for real too). Then you can press i to insert text:

/*
* Prevent timeout for a week at a time.
* (seconds * minutes * hours * days)
*/
$cfg['LoginCookieValidity'] = 60*60*24*7;

Then you can press escape to return to vim "normal" mode and :wq to write and quit.

This is what I use now... I don't mess around. In addition, on Ubuntu at least, you need to override the php.ini cookie validity length setting, see extra line below. Ignore the PHP tags, they are for formatting only.

<?php
/*
* Prevent timeout for a year at a time.
* (seconds * minutes * hours * days * weeks)
*/
$cfg['LoginCookieValidity'] = 60*60*24*7*52;
ini_set('session.gc_maxlifetime', $cfg['LoginCookieValidity']);
?>

Thanks to Ubuntu forums.

Resolution

Comments

Your comment helped with

Your comment helped with extending my phpmyadmin session time, as it was annoying to return to my computer and find my self logged out, thanks.

which file do I edit

Thanks for your write on controlling session timeout for phpmyadmin on ubuntu. It will remove a big annoyance.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.