It is possible that sometimes the time that the admin session is active is too short.
How to change the time it takes to auto-logoff the user from the back-end?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIt is possible that sometimes the time that the admin session is active is too short.
How to change the time it takes to auto-logoff the user from the back-end?
There's an menu item for this in:
Stores > Configuration > Advanced > Admin > Security > Session Lifetime (Seconds)
Also check the php environment variables
<seconds>
<seconds>
In order to ensure that you are editing the correct php.ini, create a simple "check.php" file with the following content:
<?php
phpinfo();
?>
, place the file in your magento home directory, call it from your browser (URL/check.php) and check these settings.
For more informations look here.
For Magento 2 it can be found in Left Hand Panel on the Admin.
Stores > Configuration > Advanced > Admin > Security
Admin Session Lifetime
(seconds) option in the main window.
Default value is 900 for Magento 2. For 1 hour set to 3600
(60seconds * 60minutes).
You must configure this on the "Default Config" instead of selecting a website or store view for your store view option. I tried to use it on a store view via the drop down menu in the top left and the option is not there. It does make sense since it is an administration configuration.
Note that this setting does not have any effect on the cookie lifetime at least since Magento 2.1
Another simple solution without modifing any settings is install any auto refresh addon
for your browser and set its time (60 seconds).
It will auto refresh the page for every 6o seconds which prevents session lifetime to expire and we can start working on another tab.
I used Easy Auto Refresh
and it works fine for me.
System -> Configuration -> General -> Web -> Session Cookie management
Cookie Lifetime: Change this value (i.e.: 86400).
Since Magento 2.1 the admin session lifetime is always "session", i.e. until the browser is closed. This has been introduced for security reasons.
The relevant code is in Magento\Backend\Model\Session\AdminConfig
:
/**
* Set session cookie lifetime to session duration
*
* @return $this
*/
protected function configureCookieLifetime()
{
return $this->setCookieLifetime(0);
}
If you want to change this behavior, you can add a plugin for this class with the following interceptor method:
public function beforeSetCookieLifetime()
{
$lifetime = $this->scopeConfig->getValue(
\Magento\Framework\Session\Config::XML_PATH_COOKIE_LIFETIME,
\Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT);
return [$lifetime, \Magento\Framework\Session\Config::COOKIE_LIFETIME_DEFAULT];
}
Where $this->scopeConfig
should be an instance of \Magento\Framework\App\Config\ScopeConfigInterface
, injected via constructor parameter.
This way the cookie lifetime is used from configuration, just as in the frontend.
Note that the configuration in Stores > Configuration > Advanced > Admin Security > Session Lifetime does not have any effect on the cookies anymore! It is used to determine Redis session lifetime, so if you increase the cookie lifetime, you should also increase this value.
Sunovisio actually provide an extension that allows you to keep your administration session alive while you are working on and that independently of your session timeout.
You can check it there: http://ecommerce.sunovisio.com/index.php/admin-keep-alive-1-1-0.html
Hope this extension will help you working with your Magento Administration Panel!
yes, but first you have to make sure that magento location and the server time are in the same timezone. also make sure there are no any session.* overrides in php.ini