phpmyadmin logs out after 1440 secs

后端 未结 24 1290
予麋鹿
予麋鹿 2021-01-29 23:29

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 m

相关标签:
24条回答
  • 2021-01-29 23:58

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

    session.gc_maxlifetime = 1440
    

    to

    session.gc_maxlifetime = 43200
    
    0 讨论(0)
  • 2021-01-29 23:59

    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);
    })();
    
    0 讨论(0)
  • 2021-01-30 00:00

    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/

    0 讨论(0)
  • 2021-01-30 00:00

    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

    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.

    0 讨论(0)
  • 2021-01-30 00:04

    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

    0 讨论(0)
  • 2021-01-30 00:04

    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.

    0 讨论(0)
提交回复
热议问题