skip to Main Content

This is my first Stack Overflow post ever. Hurah for me 🙂

phpMyAdmin 4.9.1. How can I change connection timeout? For now it’s 1440 seconds.

Settings/Fuatuers/General dosen’t show option “Login cookie validity”.

OS: MacOS Catalina 10.15.1 (19B88)
Google Chrome Version 78.0.3904.97 (Official Build) (64-bit)

Thanks for your help.

4

Answers


  1. in phpmyadminlibrariesconfig.default.php change

    $cfg['ExecTimeLimit'] = 1440 
    

    to

    $cfg['ExecTimeLimit'] = 0; 
    

    and restart – this will clear the limit

    Login or Signup to reply.
  2. try to add the line $cfg[‘LoginCookieValidity’] = ‘7200’ ; into config.inc.php file in PhpMyAdmin directory
    this is for two hours

    Login or Signup to reply.
  3. in phpmyadminlibrariesconfig.default.php change

    $cfg['LoginCookieValidity'] = 1440 
    

    to

    $cfg['LoginCookieValidity'] = 7200; 
    

    to make session logout after 2 Hours.

    Login or Signup to reply.
  4. 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.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search