Increasing the Admin timeout in Zen Cart 1.5.0

*** Warning: This change will violate the PCI status of your cart.  You should only do this on test carts on your own PC or on carts which do not require PCI certification. ***

To increase the Admin Timeout value to 1800 seconds (30 minutes), go to Admin->Tools->Install SQL patches, and paste the following into the “Enter the query to be executed” box:

UPDATE configuration SET
configuration_value = '1800',
set_function = 'zen_cfg_select_option(array(\'1800\', \'900\', \'600\', \'300\'), '
WHERE configuration_key = 'SESSION_TIMEOUT_ADMIN';

To change it back, go to  Admin->Configuration->My Store, and set the
Admin Session Time Out in Seconds value back to 900.

To use a value other than 30 minutes, just change the two “1800” numbers above to a number of seconds of your choosing (above 900).

Then modify /includes/functions/sessions.php as follows:

a) Find the block that looks like this:


and change it to this:


b) Find the block that looks like this:

@ini_set('session.gc_maxlifetime', (SESSION_TIMEOUT_ADMIN > 900 ? 900 : SESSION_TIMEOUT_ADMIN));

and change it to this:

@ini_set('session.gc_maxlifetime', SESSION_TIMEOUT_ADMIN);

12 thoughts on “Increasing the Admin timeout in Zen Cart 1.5.0”

  1. The code you tell us to find does not exist in 1.5.7c sessions.php. It has been modified considerably since these instructions were written.

    There is an option in admin > configuration > my store where you can disable admin timeout…making your store non-compliant with security rules.

  2. Change just the bottom line of code in the first block so it looks like this and your admin will not disappear


  3. Guys- two code changes were left out from the original post; please review the post and try again.

  4. This doesn’t seem to work for me. It does add the option to admin but when it’s selected it still times out the admin session long before the allocated amount of seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.