Session time out increase

Hi All,

We are facing issues getting session log out automatically for particular time period, So kindly let me know how to increase the session time out.

If increase the session time it will affect server performance??

Kindly give your suggestions.

Regards,

Hi,

As far as I know there isn’t any settings in SuiteCRM for this so you’ll need to update the PHP config settings in the PHP settings file.

Setting session.gc_maxlifetime to a higher value should increase the session timeout.

This will cause session files to stay around for longer but this should have no discernible effect on performance.

Thanks,
Jim

Edit: Also look at session.cookie_lifetime

1 Like

Thanks Jim,

We cannot define in files for particular folder??
Because we had 4 websites in single instance so i want increase session time in suitecrm folder alone.
Its possible??

Regards,

Hi,

I’m not sure. I believe you can change the session.gc_maxlifetime and session.cookie_lifetime in a .htacess file which should allow you to do this.
However the garbage collection of one instance may interfere with the other instances causing the sessions to be removed early. This also assumes that your hosting provider allows setting PHP configuration in .htaccess.

Best thing to do would be to try and see how it goes.

See http://php.net/manual/en/configuration.changes.php

Hope this helps,
Jim

H Jim,
Thanks, based on your reference.
I have added following code in .htaccess file, its working fine.

#Session timeout php_value session.cookie_lifetime 3600 php_value session.gc_maxlifetime 3600

Thanks & Regards,

1 Like

H Jim,
Its not working in server.

Kindly guide me how to fix on the server.

Hi All,

Anyone find out the solution for this???
Kindly suggest me.

Hi Bala,

It’s hard to say what the issue is since it is working on your test instance. Is your apache server configured the same?

You’ll have to ensure that mod_php5 is enabled and that you have enabled AllowOverride Options or AllowOverride All.

If it still isn’t working you could perhaps look into doing ini_set calls on each instance to set the values. See the Other Interfaces section of my previous link: http://php.net/manual/en/configuration.changes.php

Thanks,
Jim

Thanks Jim,
I will try same.

Hi Bala,
I was trying to achieve this too. I added these lines to my .htaccess file -


php_value session.cookie_lifetime 3600
php_value session.gc_maxlifetime 3600

as you did, however my sessions were still timing out as on your production server. Eventually I tracked it down to the fact that on my server I have several sites and all of them share the same session storage ("/var/lib/php"). One of these sites were timing out my SuiteCRM sessions. I created a folder for SuiteCRM to store it’s sessions and added this line to my .htaccess file -


php_value session.save_path /var/local/sugarcrm/sessions

So now the SuiteCRM session files are stored separately.

If you have multiple sites on your server this may help.

This is my IfModule block -


<IfModule mod_php5.c>
    php_value session.save_path /var/local/sugarcrm/sessions
    php_value session.cookie_lifetime 14400
    php_value session.gc_maxlifetime 14400
</IfModule>
1 Like

Hi Jhon,

I have single site only in the server. But if i use same commend in htaccess file, its not working. Where i can implement the code ‘htaccess’ or any server config file.

As you only have the one site have you tried settings in your “php.ini” ie “session.cookie_lifetime=14400”

We have change in the php.ini this:

session.cookie_lifetime = 0
session.gc_maxlifetime = 14 400

For now it’s work, waiting some days to test and let you know if it work good with our employe

1 Like

About 2 days now and the session stay always on. We need to log-out before quit or next day it will be always on.

It is not good as 100% but it is better than always need to reconnect