How To Increase Automatic Logout Time In phpMyAdmin

In this tutorial, we will learn how to increase automatic logout time in the PHPMyAdmin. PHPMyAdmin is an open-source web-based application that provides a graphical interface for MySQL or MariaDB databases. We all have been using PHPMyAdmin since we have started working with MySQL. it provides easy user interface for work on.

Sometimes we would have noticed that in PHPMyAdmin we automatically logouts after some idle time. And then we need to again log in to use the system. Default idle time to log out is around 1440 seconds in PHPMyAdmin and you will see the error message of ” No activity within 1440 seconds; please log in again. ” Below is the screenshot for the same.

When this kind of screen appears so you need to log in to continue work on PHPMyAdmin. When this happens again and again then it becomes very irritating and sometimes hampers the work.

In order to bypass this issue, we have to increase the logout time in the PHPMyAdmin panel.

We can achieve this by following simple steps;

First open /etc/phpmyadmin/config.inc.php setting file to nano editor. You can open the file with the below command.

sudo nano /etc/phpmyadmin/config.inc.php

And search for the below line or word using shortcut CTRL + W.

['LoginCookieValidity']

If you did not find the above line, you need to add the below mentioned line in the file, or if you found the above line just edit that as given below.

$cfg['LoginCookieValidity'] = 43200; // 24 hours

The $cfg[‘LoginCookieValidity’] defines how many seconds login cookie is valid. You can set it as per your convenience if you want to increase the logout time more you can simply put the higher value there.

Now save and exit the file. You also need to check the PHP configuration option session.gc_maxlifetime at least or more than the value of $cfg[‘LoginCookieValidity’]. So, you might need to set the session.gc_maxlifetime n /etc/php/8.0/apache2/php.ini configuration file in Ubuntu.

Note: You may be using a different version than 8.0. So your path should be like /etc/php/<version.subversion>/apache2/php.ini

To check which php.ini file exactly using, create info.php file in /var/www/html and print fileinfo() function.

phpinfo();

Now open http://localhost/info.php in the browser and search for the line Loaded Configuration File.

If you don’t want to change this file, you may change the php.ini configuration runtime for phpMyAdmin only. PHP allows to change configurations using ini_set() function.

$session_timeout = 43200; // 24 hours
ini_set('session.gc_maxlifetime', $session_timeout);
$cfg['LoginCookieValidity'] = $session_timeout;

So, this way you can change the automatic logout time in phpMyAdmin. I hope this tutorial will help you find a solution.

You can check other tutorials related to PHPMyAdmin

How to import CSV file into PHPMyAdmin

How to Back Up a MySQL Database in cPanel