cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9 admin session lifetime - How to extend?

Magento 1.9 admin session lifetime - How to extend?

 

I'm having issues setting the admin session lifetime.  Nothing I've done has worked this far. Any help with this would be greatly appreciated. What I have tried so far. Current Admin time out 28 minutes. Wanting to change to 86400.

 

Magento 1.9.4

 

System -> Configuration -> GENERAL -> Web -> Session Cookie Management 

Cookie Lifetime 86400

Cookie Path /

Cookie Domain www.mysite.com

Use HTTP Only No

Cookie Restriction Mode No

 

------------------------------------------------------------------------

 

Stores -> Configuration -> ADVANCED -> Admin -> Security

Session Lifetime (seconds) 86400

 

-------------------------------------------------------------------------------

 

FTP Server Root Directory

php.ini file changed to "session.cache_expire = 86400"

 

--------------------------------------------------------------------------------

 

app\code\core\Mage\Core\Model\Session\Abstract\Varien.php

 

if (Mage::app()->getStore()->isAdmin())
{

     $adminSessionLifetime = (int)Mage::getStoreConfig(’admin/security/session_cookie_lifetime’); 
       if ($adminSessionLifetime > 86400) 
       { 
          Mage::getSingleton(’core/cookie’)->setLifetime($adminSessionLifetime); 
       }
}

 

 

 

 

1 REPLY

Re: Magento 1.9 admin session lifetime - How to extend?

Check the other PHP values you might have set, like session.cookie_lifetime and session.gc_maxlifetime.  They could be interfering.

 

Assuming PHP is not the problem, you can edit this value directly via MySQL, run a query like :

 

select * from core_config_data where path like "%cookie%";

You will see a value like

 1177 | default |        0 | admin/security/session_cookie_lifetime     | NULL     

Update it there, in the above example it is NULL so you can update it like so

update core_config_data set value=86400 where config_id=1177;

 You just need to alter the queries to suit your particular store.