===== Changing Session Length ===== By default, a zencart session will timeout after 24 minutes of inactivity. This will log someone out, or delete their temporary shopping cart if they weren't logged in. Depending on your shop you might want this to be longer or shorter. Before we begin, make sure that the STORE_SESSIONS constant in **includes/configure.php** is set to 'db' and not ''. You should have this line: define('STORE_SESSIONS', 'db'); If this is not set to 'db', then this mod will certainly not work. Ok, so to change the session length, find these lines in **includes/functions/sessions.php** if (STORE_SESSIONS == 'db') { if (defined('DIR_WS_ADMIN')) { if (!$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900)) { $SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900); } } else { if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) { $SESS_LIFE = 1440; } } As you can probably tell, there are 2 ways we can go about this. The first is to edit **php.ini** on your server and set **session.gc_maxlifetime** to a new value. The other option, which you might prefer if you don't have access to your php.ini file, is to replace the above lines of code with if (STORE_SESSIONS == 'db') { if (defined('DIR_WS_ADMIN')) { if (!$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900)) { $SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900); } } else { $SESS_LIFE = 86400; } The $SESS_LIFE variable is stored in seconds, so 86400 = (24 * 60 * 60) = 1 day. For extra credit, you can even set the value to a db-stored variable for easy updating. Note: It is very important not to do this mod if you are using filesystem-based sessions. While zencart manages db sessions, filesystem based sessions will get garbage-collected by the server regardless of zencarts **$SESS_LIFE** variable.