Whenever a user is logged into my website, he is automatically signed out after a fixed amount of time. How can I modify this time?
1. I want user to be logged out only when he clicks on “Logout” button. The time when he click the logout button might be 2 weeks, 1 month or longer.
2. I want user to keep logged in even if he closes the web-browser and reopens it. How can I do this?
Please help. Thanks.
I changed as you suggested but it is not working. Any idea why?
I have changed it to the following
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) { $SESS_LIFE = 864000; //10 days }
Below are my settings in Admin panel:
Session Directory: <…>/public_html/catalog/includes/work/
Force Cookie Use: False
Check SSL Session ID: False
Check User Agent: False
Check IP Address: False
Prevent Spider Sessions: True
Recreate Session:True
Any suggestion on the above? Please help.
Thank you.
Well, one obvious reason for that failing is if the default PHP session.gc_maxlifetime value is defined and is set to something other than zero (which will often be the case). The inner code will not be executed at all, and it doesn’t matter what value you set it to.
So I suggest replacing these three lines of code:
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) { $SESS_LIFE = 1440; }
with just the one line:
$SESS_LIFE = 864000; //10 days
source from https://www.oscommerce.com/forums/topic/387251-increase-session-timeout/