How to change the Magento administrative session timeout interval

This article describes how to change the administrative session timeout interval in Magento.

Changing the session timeout interval

By default, Magento automatically logs out administrators when connections are idle for a certain amount of time (specifically, the value of the session.gc_maxlifetime PHP directive). However, you can increase or decrease this interval according to your own requirements.

To determine the current value of the session.gc_maxlifetime PHP directive on your server, use the phpinfo() function as described in this article.
Magento 2

To change the session timeout interval for the administrator in Magento 2, follow these steps:

  1. Log in to Magento using your administrator account.
  2. In the left sidebar, click Stores, and then under Settings, click Configuration.
  3. Click Advanced, and then click Admin.
  4. Under Security, in the Admin Session Lifetime (seconds) text box, type the session timeout interval in seconds that you want to use. For example, a value of 1200 sets a timeout interval of 20 minutes.
  5. Click Save Config.
  6. Log out of Magento, and then log back in. The new session timeout interval is now active.
Magento 1.9 and older versions

To change the session timeout interval for the administrator in Magento 1.9 and older versions, follow these steps:

  1. Log in to Magento using your administrator account.
  2. On the top menu bar, click System, and then click Configuration.
  3. In the Configuration pane on the left side, scroll down the page, and then under ADVANCED, click Admin.
  4. Click Security.
  5. In the Session Lifetime text box, type the session timeout interval in seconds that you want to use. For example, a value of 1200 sets a timeout interval of 20 minutes.
  6. Click Save Config.
  7. Log out of Magento, and then log back in. The new session timeout interval is now active.

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.