phpmyadmin logs out after 1440 secs
Asked Answered
B

26

150

In my local development Ubuntu box I use MySQL and phpmyadmin to work with the database.

Whenever phpmyadmin is idle for 1440 secs (24min) the session expires. I lose my place and have to login and start over.

I tried changing the $cfg['LoginCookieValidity'] = 3600 * 9; inside config.inc.php but it still times out in 1440 seconds.

I have restarted everything and cleared the browser cache (Firefox history -> Clear recent history -> Cache -> Everything).

I'm not sure why the increased timeout does not take effect. What am I doing wrong?

Bumpkin answered 4/12, 2012 at 7:12 Comment(4)
The first thing that comes to my mind is, did you restart the webserver after changing config.inc.php?Providing
Yes i had ran this command: sudo service mysql restartBumpkin
If you have solved this problem, can you please post the solution as an answer here? ;)Providing
For Ubuntu 18.04 I just edited the file /usr/share/phpmyadmin/libraries/config.default.php Change: $cfg['LoginCookieValidity'] = 1440Collegian
B
0

I have found the solution and using it successfully for sometime now.

Just install this Addon to your FF browser.

Bumpkin answered 9/5, 2014 at 14:17 Comment(4)
Great suggestion, since the entire world uses firefox.. For this to marked as answer, you should at least have suggested addons for more than 1 browser - since most normal people use a decent browser such as google chrome..Balakirev
using an addon for such a specific and trivial problem seems overwhelming to me.Edwinaedwine
This does not answer the question. This should not be the accepted answer. You were asking: “I'm not sure why the increased timeout does not take effect. What am I doing wrong?”Usher
this is completely irrelevant answer. Either user need to change "selected answer" or we involve moderator to look into this?Ambivert
S
211

Go to PHPMyAdmin in your browser

Settings > Features > Change the value of Login cookie validity > Saveenter image description here

NOTE: You will have to do this per session.

Spitz answered 20/5, 2015 at 17:40 Comment(10)
This is the fastest and the easiest solution for this problem. It should be the answer !!!Autoerotic
It is not permanent solution. I have tried doing this but after one or two days it again resets to 1440 seconds.Ange
This only works for the current session. It even says so in the settings.Giddens
don'f forget to update php.ini setting session.gc_maxlifetime = SAME_OR_BIGGER_VALUE_AS_PHPMYADMINCollaborationist
FYI: not the best option. It saves to current session onlyMasturbation
Nice answer @Pavnish Yadav.Diamagnet
The version 4.8.5 doesn't have this optionLawley
how can I activate this setting? It is not available on the UI of the phpmyadmin 4.8.4 eitherBroken
There is no settingsGrams
For Ubuntu 18.04 I just edited the file /usr/share/phpmyadmin/libraries/config.default.php Change: $cfg['LoginCookieValidity'] = 1440Collegian
C
78

Add this line to /config.inc.php:

$cfg['LoginCookieValidity'] = 36000;

In /setup/lib/index.lib.php

$cf->getValue('LoginCookieValidity') > 36000;

If you don't already have a .htaccess file for your phpMyAdmin site, create one, and add the following line to override the default PHP session timeout:

php_value session.gc_maxlifetime 36000

I would not recommend altering this value in your main php.ini file, as it will allow a ridiculously long session timeout for all your PHP sites.

source: http://www.sitekickr.com/blog/increase-phpmyadmin-timeout/

Criminality answered 16/10, 2013 at 16:50 Comment(6)
if I can add to this, also change in config.default.php line 698 from $cfg['LoginCookieValidity'] = 1440; to $cfg['LoginCookieValidity'] = 36000;Gove
instead of putting the first line in phpmyadmin/config.inc.php put it in a new file in the directory phpmyadmin/conf.d so that it won't be overwritten on an upgradeMorell
You can also extend the gc_maxlifetime by adding the following to your config.inc.php file (typically in the /etc/phpmyadmin directory): ini_set('session.gc_maxlifetime', '36000'); This will also localize it to phpmyadmin and not affect the Garbage Collection period of other PHP scripts. And, based on the documentation, the config.inc.php file is meant to be used to alter behavior -- see docs.phpmyadmin.net/en/latest/config.html. Thus, no worries about this file being altered by an upgrade.Bane
I just tried this, and it looks like step 2 isn't needed. Just the config file change, and the .htaccess change.Blitz
For Ubuntu 18.04 the file is /usr/share/phpmyadmin/libraries/config.default.phpCollegian
On MacOS the most common location of phpMyAdmin is /usr/local/share/phpmyadminGe
G
55

We can change the cookie time session feature at:

Settings -> Features -> General -> Login cookie validity

I found the answer in here.. No activity within 1440 seconds; please log in again

EDIT:

This solution will work only for the current session, to change permanently do:

open config.inc.php in the root phpMyAdmin directory .

wamp folder: wamp\apps\phpmyadmin{version}\config.inc.php

ubuntu: /etc/phpmyadmin

add this line

$cfg['LoginCookieValidity'] = <your_timeout>;

Example

$cfg['LoginCookieValidity'] = '144000';
Gabriella answered 18/1, 2014 at 20:15 Comment(5)
You have to change session.gc_maxlifetime in php.ini to higher than default value : 1440 too.Pricilla
This answer is very incomplete and should not be the top vote getter. Changing through the settings gives the following warning: "Your preferences will be saved for current session only. Storing them permanently requires phpMyAdmin configuration storage."Sloppy
@Sloppy here I have placed a more complete answer which is working fine regarding to this answer.Downes
Note that you can't set a value greater than 9223372036854775806 or it will result in a integer overflow.Wellington
PS. if there is no config file in the phpmyadmin folder choose the sample one provided: phpmyadmin{version}\config.sample.inc.php and rename it to config.inc.phpTrabeated
A
23

You can change the cookie time session feature at phpmyadmin web interface

Settings->Features->General->Login cookie validity

OR

If you want to change the 'login cookie validity' in configuration file, then open the phpmMyAdmin configuration file, config.inc.php in the root directory of PHPMyAdmin.(root directory is usually /etc/phpmyadmin/)

After locating the config.inc.php , search for the line below and set it to the value of seconds you want phpmyadmin to timeout:

$cfg['LoginCookieValidity'] 

or

Add the following:

$cfg[ ' Servers'] [$i] [ ' LoginCookieValidity' ] = <your_new_timeout>;

For example:

$cfg[ ' Servers'] [$i] [ ' LoginCookieValidity' ] = <3600 * 3 >;

The Timeout is set to 3 Hours from the Example above.

session.gc_maxlifetime might limit session validity and if the session is lost, the login cookie is also invalidated. So, we may need to set the session.gc_maxlifetime in php.ini configuration file(file location is /etc/php5 /apache2/php.ini in ubuntu).

session.gc_maxlifetime = 3600 * 3


phpMyAdmin Documentation on LoginCookieValidity

$cfg['LoginCookieValidity']

Type: integer [number of seconds]
Default value: 1440

Define how long a login cookie is valid. Please note that php configuration option session.gc_maxlifetime might limit session validity and if the session is lost, the login cookie is also invalidated. So it is a good idea to set session.gc_maxlifetime at least to the same value of $cfg['LoginCookieValidity'].

NOTE:

  1. If your server crashed and cannot load your phpmyadmin page, check your apache log at /var/log/apache2/error.log. If you got PHP Fatal error: Call to a member function get() on a non-object in /path/to/phpmyadmin/libraries/Header.class.php on line 135, then do a chmod 644 config.inc.php. that should take care of the error.
  2. You will then get another warning: Your PHP parameter session.gc_maxlifetime is lower that cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.. then change the session.gc_maxlifetime as mentioned above.
Aeromechanics answered 7/8, 2014 at 6:14 Comment(1)
Why are you even assuming Apache is involved?Effulgence
A
17

There seems to be UI for changing phpmyadmin configurations Start apache and click the following link

http://localhost/phpmyadmin/setup/index.php?page=form&formset=Features#tab_Security

Anthropophagi answered 10/10, 2013 at 21:19 Comment(1)
This link leads to phpMyAdmin setup. Changing settings of working application through it's installation script is a little bit risky, don't you think?Gooding
D
13

Steps for doing this using phpMyAdmin settings without any problem or requirements to change configs in php my.ini or defining .htaccess file:

  1. Goto your phpMyAdmin install path (ex. /usr/share/phpMyAdmin/ on my centos7) and find create_tables.sql in one of its subfolders (phpMyAdmin/sql/create_tables.sql in my 4.4.9 version.) and execute whole file contents on your current phpMyAdmin site from your web browser. This will create a database named phpmyadmin which can keep all your phpMyAdmin options saved permanently.
  2. In phpMyAdmin's config.inc.php (located on /etc/phpMyAdmin/ in my centos7 server) find the commented line $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; and uncomment it (Now phpMyAdmin will use that custom database we generated in previous step).
  3. Goto phpMyAdmin from web browser and goto Server >> Settings >> Features >> "Login Cookie Validity" as in picture described by Pavnish and set the desired value. It works now.

References: Niccolas Answer ,PhpMyAdmin Configuration Storage, flashMarks Answer

Downes answered 6/9, 2015 at 11:59 Comment(1)
This doesn't work on phpMyAdmin 4.8.3. Making the simple complex again. I recall before this update (I was using 4.4 or so) everything worked fine via Server >> Settings >> Feagtures, as said here. Not anymore. The config.inc.php doesn't come with that lineLeavenworth
C
9

You will then get another warning: “Your PHP parameter session.gc_maxlifetime is lower that cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.“. That makes sense because php’s session will time out first anyways. So we will need to change /etc/php.ini .

session.gc_maxlifetime = 43200
That’s 12 hours in seconds. 

Restart your apache server and you are done!

source: http://birdchan.com/home/2011/06/06/phpmyadmin-timeout-after-1440-seconds/

this works for me! :)

Corwun answered 22/5, 2013 at 7:15 Comment(0)
E
8

To set permanently cookie you need to follow some steps

Goto->/etc/phpmyadmin/config.inc.php file

add this code

$cfg['LoginCookieValidity'] = <cookie expiration time in seconds > 
Exposed answered 14/5, 2015 at 10:15 Comment(1)
PS. if there is no config file in the phpmyadmin folder choose the sample one provided: phpmyadmin{version}\config.sample.inc.php and rename it to config.inc.phpTrabeated
P
7

You should restart apache or httpd, not mysqld

sudo service httpd restart

or

sudo /etc/init.d/apache2 restart
Providing answered 4/12, 2012 at 7:26 Comment(5)
Now i have restarted apache using ur command (i.e sudo /etc/init.d/apache2 restart), but still phpmyadmin logs out after 1440 secs.Bumpkin
Do you see the the error "No activity within 1440 seconds; please log in again" or it just logs out? If it logs out check session.gc_maxlifetime in your /etc/php.ini, what is the value of this?Providing
yeah i see this message: "No activity within 1440 seconds; please log in again"Bumpkin
This is really weird. Can you please set session.gc_maxlifetime=3600*9 in /etc/php.ini, too and restart the webserver and try again? Just for faster debugging set both of them (session.gc_maxlifetime and $cfg['LoginCookieValidity']) to something small, e.g, 50 (seconds) and then restart the webserver, clear your browser's cache and try again.Providing
Can you clarify how, restarting the service should change configuration of anything?Gooding
S
7

You just Increase the phpMyAdmin Session Timeout, open config.inc.php in the root phpMyAdmin directory and add this line.

from the wamp folder path wamp\apps\phpmyadmin4.0.4\config.inc.php

$cfg['LoginCookieValidity'] = <your_timeout>;

Example

$cfg['LoginCookieValidity'] = '1440';

Note: short cookie lifetime is all well and good for the development server not for your production server.

Sluff answered 11/3, 2014 at 6:55 Comment(0)
G
7

1) Login to phpMyAdmin 2) From the home screen click on "More settings" (middle bottom of screen for me) 3) Click the "Features" tab/button towards the top of the screen. 4) For 20 days set the "Login cookie validity" setting to 1728000 5) Apply.

php xampp

Gert answered 31/7, 2015 at 9:54 Comment(0)
A
5

It is not working. The PHP session will expire anyway after 1440 seconds.

Change in PHP.ini this too:

session.gc_maxlifetime = 3600

http://www.phpmyadmin.net/documentation/Documentation.html#config

Also, from PHP.ini:

If you are using the subdirectory option for storing session files

; (see session.save_path above), then garbage collection does not

; happen automatically. You will need to do your own garbage

; collection through a shell script, cron entry, or some other method.

; For example, the following script would is the equivalent of

; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):

; cd /path/to/sessions; find -cmin +24 | xargs rm

Alexandro answered 31/3, 2014 at 10:53 Comment(0)
C
5

change in php.in file from wampicon/php/php

session.gc_maxlifetime = 1440

to

session.gc_maxlifetime = 43200
Carroll answered 1/5, 2014 at 7:27 Comment(0)
V
4

If the parameter $cfg['LoginCookieValidity'] is not taking effect in config.inc.php file, try disabling the session.gc_maxlifetime in the php.ini file by putting a semicolon to the left like this:

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
; session.gc_maxlifetime = 1440

Or try disabling both $cfg['LoginCookieValidity'] and session.gc_maxlifetime = 1440 by commenting both out.

Then phpMyAdmin should no longer log out when you idle. It works for me on Windows. Don't forget to clear your browser cache and restart your webserver.

Vittle answered 27/10, 2013 at 5:57 Comment(2)
i almost forgot. After you apply those changes, clear your browser cache and restart your webserver! cheers mate.Vittle
I think, it is actually $cfg['Servers'][$i]['LoginCookieValidity'], not the $cfg['LoginCookieValidity'], that should be set, if you have phpMyAdmin's many-server-like configuration in config.inc.php. And no, commenting out the $cfg['Servers'][$i]['LoginCookieValidity'] won't bring any result, as this value is gone by default. So with this parameter commented out or removed, phpMyAdmin seems to be falling back to default 1440 seconds.Gooding
N
4

steps to change cookie expiration

step 1:Go to settings of Phpmyadmin

step 2:General

step 3:Login cookie validity

step 4:Update 1440 seconds default cookie expiration time with your new value

Nightgown answered 8/5, 2015 at 13:10 Comment(1)
it will work only for a particular session after that it will again set to the 1440 secondsNightgown
B
3

If you have phpmyadmin configuration storage setup, the settings will be pulled out of your phpmyadmin.pma__userconfig table, and will override anything you have in config.inc.php. In this table, each MYSQL user can be assigned a different set of phpmyadmin settings.

Batey answered 16/1, 2014 at 6:43 Comment(0)
H
3

===method 1 with http login===

[php.ini]
session.gc_maxlifetime = 86400

[config.inc.php]

$cfg['Servers'][$i]['auth_type']     = 'http';

===method 2 with cookie login===

[php.ini]

session.gc_maxlifetime = 86400

[config.inc.php]

$cfg['Servers'][$i]['auth_type']     = 'cookie';

$cfg['Servers'][$i]['LoginCookieValidity'] = 86400;

$cfg['Servers'][$i]['pmadb']         = 'phpmyadmin';

$cfg['Servers'][$i]['controluser']   = 'phpmyadmin_pma';

$cfg['Servers'][$i]['controlpass']   = 'nigookike';

$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; // there's a lot of other table required for full functionality,
                                                                         // all others can be left out unconfig except this one

[mysql]
-import phpMyAdmin/sql/create_tables.sql

-grant PRIVILEGES to phpmyadmin_pma as below

db/table

phpmyadmin  ALL PRIVILEGES 

mysql/db    SELECT

mysql/host  SELECT

mysql/tables_priv   USAGE

mysql/user  USAGE


-clear all entries should old one exists

phpmyadmin/pma__userconfig

[webUI]

-clear broswer cookie

-as normal mysql user, access http://mysql/phpmyadmin , at the bottom of page:

    The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. [Find out why.]

-near top of the page

    [Create missing phpMyAdmin configuration storage tables.]

-access http://mysql/phpmyadmin > settings > features > Login cookie validity > 86400 > [apply]

-check phpmyadmin/pma__userconfig contain new entries of aforemention mysql user

N.B.

  1. every user has independent setting and [webUI] procedure has to be repeated for each user

  2. if "The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. [Find out why.]"

link does not appears on frontpage, go settings > features > warnings > Missing phpMyAdmin configuration storage tables > [refresh] a few times will make it appears

Hawker answered 24/3, 2018 at 4:17 Comment(1)
Please format this snippet properly. Otherwise it is nearly unreadable.- even though the content looks promising.Suppuration
B
2

After I tried all suggested methods here and still kept getting logged out, I turned to writing a small usercsript for Tampermonkey as I already have that extension. It is very simple and just sends a request to one of low footprint scripts of PHPMyAdmin once every minute. Here is the code:

// ==UserScript==
// @name         PHPMyAdmin Keep Session Alive
// @namespace    https://www.bitwizeor.io/
// @version      0.1
// @description  No more nasty PHPMyAdmin session expiries
// @match        http://localhost/phpmyadmin/*
// ==/UserScript==

(function() {
    'use strict';
    console.log('PHPMyAdmin Keep Session Alive activated');
    var url;
    window.setInterval(function(){
        url = $("#serverinfo a:eq(1)").prop("href");
        url += '&ajax_request=true&ajax_page_request=true';
        $.getJSON(url);
        console.log('pinging ...');
    }, 60000);
})();
Bainbrudge answered 24/12, 2016 at 20:27 Comment(0)
V
2

Follow below steps to increase session timeout for phpmyadmin:

Method 1:

  • Login to phpMyAdmin with your root credentials
  • Select Settings from the top in navigation bar
  • Tap on Features
  • Search for Login cookie validity field in General tab
  • Change the value for this field to something greater than 1440 like 36000 or anything higher.

Make sure whatever value you are entering in Login cookie validity is in seconds

phpmyadmin increase session timeout

Method 2:

Locate your config.inc.php file

For CentOS, Fedora servers:
/etc/phpMyAdmin/config.inc.php

For Ubuntu, Debian servers:
/etc/phpmyadmin/config.inc.php

Search LoginCookieValidity in config.inc.php and increase its value

$cfg['Servers'] [$i] ['LoginCookieValidity'] = 1440;

//change to 
$cfg['Servers'] [$i] ['LoginCookieValidity'] = 36000;

Save the changes to the config.inc.php file and restart your server.

Increase session.gc_maxlifetime in php.ini to be greater than or equal to the value that you entered in config.inc.php.

Validity answered 19/9, 2020 at 4:52 Comment(3)
Method two is the one he used and said it didn't help.Hermes
@JonathanJ.Pecany Did you restarted the server and checked after that? You need to refresh your phpmyadmin session as well.Validity
I have restarted my server. I did all these steps a while ago.Hermes
R
1

It worked for me after I

  • changed the $cfg['LoginCookieValidity'] in (phpmyadmin folder)/libraries/config.default.php to 999999999.

  • checked the php.ini used by the phpmyadmin by php5 -i | grep php.ini.

  • went to the php.ini file whose path I got from the grep command output and changed the session.gc_maxlifetime value to 999999999.

  • restarted the server. In my case it was sudo service apache2 restart.

Done. Logged in phpmyadmin and checked the cookie validity in Settings -> Features -> General -> Login cookie validity. It was 999999999. Also there was no warning "Your PHP parameter session.gc_maxlifetime is lower that cookie validity ...". The warning showed after I logged in phpmyadmin before I changed the php.ini file.

Check the version of php used by the phpmyadmin. You should change the ini file of the php that is used by the phpmyadmin. I have php5 and php(i.e 7) both installed. But my phpmyadmin uses php5. So I had to search for ini file of php5.

Roubaix answered 5/1, 2018 at 12:56 Comment(0)
R
1

DOCKER containers (laradock)

PHPMYADMIN NO EXIT (Prevent Docker container phpMyAdmin to automatically logout if no interaction for 1440 seconds)

  1. Run this command in CMD or Git Bash "containers" project folder (with 'winpty' at beginning for Windows users)

winpty docker-compose exec phpmyadmin bash

  1. Copy with rename the following file in the current (phpmyadmin container) directory (/var/www/html) --(syntax: 'cp oldfile newfile'):

cp config.sample.inc.php config.inc.php

  1. Install (if no text editor installed) VIM with:

apt-get update ; apt-get install vim -y

  1. Edit the file we copied above with vim:

vim config.inc.php

  1. Add the line bellow by press Insert or i on a NEW LINE:
    (86400 = one day, 2500000 = one month)
$cfg['LoginCookieValidity'] = 86400;
  1. Press Esc key
  2. Type :wq then Enter

NOTE: Another instruction from @zelcon above:

instead of putting the first line in phpmyadmin/config.inc.php put it in a new file in the directory phpmyadmin/conf.d so that it won't be overwritten on an upgrade

Referee answered 9/4, 2021 at 18:29 Comment(0)
B
0

I have found the solution and using it successfully for sometime now.

Just install this Addon to your FF browser.

Bumpkin answered 9/5, 2014 at 14:17 Comment(4)
Great suggestion, since the entire world uses firefox.. For this to marked as answer, you should at least have suggested addons for more than 1 browser - since most normal people use a decent browser such as google chrome..Balakirev
using an addon for such a specific and trivial problem seems overwhelming to me.Edwinaedwine
This does not answer the question. This should not be the accepted answer. You were asking: “I'm not sure why the increased timeout does not take effect. What am I doing wrong?”Usher
this is completely irrelevant answer. Either user need to change "selected answer" or we involve moderator to look into this?Ambivert
B
0

I know this is an old post but I tried every solution I read, including those on this page to no avail, and then I got lucky so I'm posting it here.

I'm running Ubuntu 17.10.

I archived /etc/phpmyadmin/config.inc.php and replaced its content with the content of /usr/share/phpmyadmin/config.sample.inc.php.

I then

 1) Enabled (uncommented) all the options under "Storage database and tables"; 
 2) Included "ini_set('session.gc_maxlifetime', 86400);" underneath the uncommented items; and 
 3) Provided a 32 character sequence for the $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */, which is above the uncommented items.

I saved the file and restarted phpMyAdmin.

I selected Server: localhost -> Settings -> Features and changed the value of "Login cookie validity" to 86400 (24 hours). Note any non default value you specify will cause the background color of this option to become yellow so don't be alarmed by it. The value should be less than or equal to the value you used in config.inc.php.

I saved the settings, exited, and restarted phpMyAdmin.

Finally, all of the messages disappeared. My session stays active as per the settings (all day in this case), and my settings are remembered.

I surely hope this helps someone. It was frustrating for me to deal with and resolve.

Booth answered 16/2, 2019 at 20:59 Comment(0)
N
0

drive here your wamp installed then go to wamp then apps then your phpmyadmin version folder then go to libraries then edit config.default.php file e.g

E:\wamp\apps\phpmyadmin4.6.4\libraries\config.default.php

here you have to change

$cfg['LoginCookieRecall'] = true;

to

$cfg['LoginCookieRecall'] = false;

also you can change time of cookie instead to disable cookie recall

$cfg['LoginCookieValidity'] = 1440;

to

$cfg['LoginCookieValidity'] = anthing grater then 1440 

mine is

 $cfg['LoginCookieValidity'] = 199000;

after changing restart your server enter image description here

also there is another method but it reset when ever we restart our wamp server and here is that method also

login to your phpmyadmin dashbord then go to setting then click on features and in general tab you will see Login cookie validity put anything greater then 14400 but this is valid until next restart of your server.

enter image description here

Nitpicking answered 20/11, 2019 at 22:22 Comment(0)
C
0

For Ubuntu 18.04 I just edited the file /usr/share/phpmyadmin/libraries/config.default.php

Change: $cfg['LoginCookieValidity'] = 1440

Collegian answered 11/12, 2019 at 11:34 Comment(0)
L
0

If you're using phpMyAdmin in a DOCKER container:


  1. Go to your TERMINAL and list your docker containers in order to find out the phpmyadmin one:
$ docker ps

# EXAMPLE OF OUTPUT: 

CONTAINER ID   IMAGE                   COMMAND                  CREATED       STATUS       PORTS                                      NAMES
93dfa1f49775   php:7.4.1-fpm           "docker-php-entrypoi…"   2 weeks ago   Up 2 weeks   9000/tcp                                   docker_localhost_app
36299ca6ce83   nginx:alpine            "/docker-entrypoint.…"   2 weeks ago   Up 2 weeks   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   docker_localhost_nginx
c1d8e6ffd28c   phpmyadmin/phpmyadmin   "/docker-entrypoint.…"   2 weeks ago   Up 2 weeks   0.0.0.0:8080->80/tcp                       docker_localhost_myadmin
d75778f88cc6   mysql:5.6               "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks   0.0.0.0:3306->3306/tcp                     docker_localhost_db

  1. Execute bash in the chosen container:
$ docker exec -it docker_localhost_myadmin bash

root@c1d8e6ffd28c:/var/www/html#

In this case docker_localhost_myadmin is the name of my container.


  1. Install vim editor in order to change the file that have the timeout variable. Execute that:
$ apt update
$ apt upgrade
$ apt install vim

  1. Edit the file config.default.php:
$ vim /var/www/html/libraries/config.default.php

  1. Find out and change the variable $cfg['LoginCookieValidity'] from 1440 to 28800(8 hours):

To find out the variable on vim, press / and type LoginCookieValidity

Before:

  $cfg['LoginCookieValidity'] = 1440 

After:

  $cfg['LoginCookieValidity'] = 28800; 

NOTE 1: DO NOT set 0(zero) as it will make your phpMyAdmin logout immediately.

NOTE 2: You may face a message on your phpMyAdmin like:

Your PHP parameter session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin, because of this, your login might expire sooner than configured in phpMyAdmin.

In this case, change the environment variable session.gc_maxlifetime on your docker-compose.yml to - session.gc_maxlifetime=28800 or bigger.


  1. Restart your container:
$ /etc/init.d/apache2 reload

  1. Logout and Login your phpMyAdmin to see the results.
Losse answered 9/4, 2021 at 13:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.