How can I change the phpmyadmin automatic log out time?
It will log out automatically after 1440 seconds which is very low for me. How can I change the option or remove log in request completely?
How can I change the phpmyadmin automatic log out time?
It will log out automatically after 1440 seconds which is very low for me. How can I change the option or remove log in request completely?
Create or edit your php.ini
file and set this variable value in it:
session.gc_maxlifetime = 1440
The integer is in seconds. 500000 seconds is 5.7 days. Then restart apache.
session.gc_maxlifetime
value ? –
Hedva session.gc_maxlifetime
and LoginCookieValidity
(see below). As for it being a "security issue" (slaver113): er, yes, you do this for your development server, not your production server. Perhaps some people here already knew that. –
Draftsman Changing php.ini will change the session duration for all the websites running on the server. To change it just for PhpMyAdmin, open config.inc.php
and add:
$sessionDuration = 60*60*24*7; // 60*60*24*7 = one week
ini_set('session.gc_maxlifetime', $sessionDuration);
$cfg['LoginCookieValidity'] = $sessionDuration;
sudo gedit /etc/phpmyadmin/config.inc.php
for ubuntu / gnome –
Doubletongue php_admin_value
lines? –
Anne In PHPMyAdmin 4 this no longer appears in the config.inc.php file. Instead go to PHPMyAdmin in your browser. Ensure you are at the localhost level to see the Settings link. Then set Settings > Features > Change the value of 'Login cookie validity' > Save
Your preferences will be saved for current session only. Storing them permanently requires phpMyAdmin configuration storage.
? Click the link in this, and it will give you instructions for enabling the ability to permanently store changes. –
Buine Your PHP parameter session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.
You will have to apply Ravinder Singh's answer as well as this one. –
Hayfield Create or edit your php.ini
file and set this variable value in it:
session.gc_maxlifetime = 1440
The integer is in seconds. 500000 seconds is 5.7 days. Then restart apache.
session.gc_maxlifetime
value ? –
Hedva session.gc_maxlifetime
and LoginCookieValidity
(see below). As for it being a "security issue" (slaver113): er, yes, you do this for your development server, not your production server. Perhaps some people here already knew that. –
Draftsman You can change the cookie time session feature at phpmyadmin web interface
Settings->Features->General->Login cookie validity
OR
If you want to change the 'login cookie validity' in configuration file, then open the phpmMyAdmin configuration file, config.inc.php
in the root directory of PHPMyAdmin.(root directory is usually /etc/phpmyadmin/)
After locating the config.inc.php , search for the line below and set it to the value of seconds you want phpmyadmin to timeout:
['LoginCookieValidity']
If you couldn't find the above line, just add the following:
$cfg['Servers'][$i]['LoginCookieValidity'] = <your_new_timeout>;
For example:
$cfg['Servers'][$i]['LoginCookieValidity'] = 3600 * 3;
The Timeout is set to 3 Hours from the Example above.
session.gc_maxlifetime
might limit session validity and if the session is lost, the login cookie is also invalidated. So, we may need to set the session.gc_maxlifetime in php.ini
configuration file(file location is /etc/php5 /apache2/php.ini in ubuntu).
session.gc_maxlifetime = 3600 * 3
$cfg['LoginCookieValidity']
Type: integer [number of seconds]
Default value: 1440
Define how long a login cookie is valid. Please note that php configuration option session.gc_maxlifetime might limit session validity and if the session is lost, the login cookie is also invalidated. So it is a good idea to set session.gc_maxlifetime at least to the same value of $cfg['LoginCookieValidity'].
NOTE:
PHP Fatal
error: Call to a member function get() on a non-object in
/path/to/phpmyadmin/libraries/Header.class.php
on line 135, then do
a chmod 644 config.inc.php
. that should take care of the error.Your PHP parameter
session.gc_maxlifetime is lower that cookie validity configured in
phpMyAdmin, because of this, your login will expire sooner than
configured in phpMyAdmin.
, then change the session.gc_maxlifetime
as mentioned above.For LOCAL installs only, you can remove the login and timeout altogether - this seems to be what you're after. By changing the authorization type to "config" and entering your database username and password in your config file you are automatically logged in. Add to config.inc.php
:
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Of-course if you do this on a server on the internet, some cheeky chappy will come along and gleefully download all your passwords and delete your website. This is for a development server running on your own laptop only.
An easier way to customise phpmyadmin these days is to go to http://www.example.com/phpmyadmin/setup/ , save all your settings section at a time, click save or download at the bottom, copy the file generated to your root phpmyadmin directory, then chmod it. You have to turn off write permission even if it is a local server as phpmyadmin checks this before it lets yo log in.
config.inc.php
–
Reefer Explore directory 'apps\phpmyadmin4.5.2' in your wamp folder and open config.inc.php file. Then add this line under existing code.
'$cfg['LoginCookieValidity'] = 3600 * 10; //login cookie validity extended upto 10 hours'.
That's all...
For phpMyadmin
5.0.2 running on Ubuntu 18.04, I edited the file as follows:
sudo nano /usr/share/phpmyadmin/libraries/classes/Config/Forms/User/FeaturesForm.php
find the method public static function getForms()
and added LoginCookieValidity field
public static function getForms()
{
$result = [
'General' => [
'VersionCheck',
'NaturalOrder',
'InitialSlidersState',
'LoginCookieValidity', //Added this line if it missing
...........
}
save the file and now you will be able to change the value from user interface.
[Settings -> General -> Features -> Login Cookie Validatity]
Server:localhost -> Settings -> Features -> General -> Login cookie validity
I have phpmyadmin 4.9.2. and try to config LoginCookieValidity, but I have auto logout :( If you using localhost you can try https://docs.phpmyadmin.net/en/latest/config.html#example-for-ip-address-limited-autologin
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'yourpassword';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
© 2022 - 2024 — McMap. All rights reserved.