Home > Database > Mysql Tutorial > body text

How to Extend or Disable Automatic Logout in phpMyAdmin?

Patricia Arquette
Release: 2024-10-26 20:33:02
Original
995 people have browsed it

How to Extend or Disable Automatic Logout in phpMyAdmin?

Extending phpMyAdmin's Automatic Logout Time

By default, phpMyAdmin automatically logs out users after 1440 seconds (24 minutes) of inactivity. However, some users may find this duration too short. This article explores how to customize this timeout or even disable the logout altogether.

To adjust the automatic logout time specifically for phpMyAdmin, users can modify the config.inc.php file. Here's a step-by-step guide:

  1. Locate the config.inc.php file within the phpMyAdmin installation directory.
  2. Open the file with a text editor.
  3. Add the following lines of code to the end of the file:
$sessionDuration = 60*60*24*7; // 60*60*24*7 = one week
ini_set('session.gc_maxlifetime', $sessionDuration);
$cfg['LoginCookieValidity'] = $sessionDuration;
Copy after login
  1. Save the changes and restart phpMyAdmin.

The code snippet above sets the session duration to one week (606024*7 seconds). Users can adjust this value to their desired duration. By default, phpMyAdmin uses the session.gc_maxlifetime value of the server, which is set in php.ini.

To completely disable the automatic logout, users can comment out the following lines in the config.inc.php file:

$cfg['LoginCookieValidity'] = $sessionDuration;
Copy after login

This modification ensures that users remain logged in indefinitely until they manually log out or close their browser.

It's important to note that changing php.ini will affect the session duration for all websites running on the server. Therefore, it's recommended to only modify phpMyAdmin's config.inc.php file to avoid unintended consequences.

The above is the detailed content of How to Extend or Disable Automatic Logout in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!