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