User login

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

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

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

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.

Shift-G is the command you

Shift-G is the command you were looking for to skip to the end of the file in vi ;-)

This is very helpful

I think that the line: ini_set('session.gc_maxlifetime', $cfg['LoginCookieValidity']); is very important. Thanks for the help.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • 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>
  • Lines and paragraphs break automatically.

More information about formatting options

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