6

How to increase automatic logout time in phpMyAdmin

 1 year ago
source link: https://www.laravelcode.com/post/how-to-increase-automatic-logout-time-in-phpmyadmin
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to increase automatic logout time in phpMyAdmin

  415 views

  1 year ago

PHP

phpMyAdmin is open-source web based application that provides graphical interface for MySql or MariaDB database. When working in phpMyAdmin, you have noticed that it automatically logouts after 1440 inactive seconds. The error message shows No activity within 1440 seconds; please log in again.

how-to-increase-automatic-logout-time-in-phpmyadmin-login-page.png

You need to again login to continue use phpMyAdmin. It is sometimes feel hard to login again and again after 1440 seconds. You might want to increase the logout time.

This can be done in simple ways changing some file values.

First open /etc/phpmyadmin/config.inc.php setting file to nano editor.

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

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

['LoginCookieValidity']

If you couldn't find this line, you need to add below line anywhere in the file.

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

The $cfg['LoginCookieValidity'] defines how many seconds login cookie is valid. You can set the seconds that you want to keep logout time.

Now save and exit the file. You also need to check 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 different version than 8.0. So your path should be like /etc/php/<version.subversion>/apache2/php.ini

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

<?php
phpinfo();

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

how-to-increase-automatic-logout-time-in-phpmyadmin-php-ini-configuration.png

If you don't want to change in this file, you may change php.ini configuration runtime for phpMyAdmin only. PHP allows to change phconfigurations 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 automatic logout time in phpMyAdmin. I hope this will help you.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK