Page 1 of 1

Session timeout

Posted: 2016-09-23 11:03
by hendrik
Dear all,
I am much more a standard user than a programmer and all the more I am excited about this software. With some basic knowledge in MS Access and LibreOffice base and after understanding to set up a lamp server I was able to create a small web based application with appgini which is perfectly stable in a multiuser environment under Linux now.

My question for the experts is now: Is there a parameter in apache server or appgini or PHP which sets the time for automatic log off during a session which is currently about 15 min. I would like to prolong the session time up to 2 hours. Reason is that in case you have been logged out automatically all the content which is still in buffers and not saved is lost.

Another idea could be to find a “simple” way to force an automatic saving in detailed view(s) e.g. every 10 seconds. But I feel that this might be much more complex compared to prolonging the correct parameter.

Best regards

Re: Session timeout

Posted: 2016-09-29 12:21
by a.gneady
please try this and kindly confirm if it fixes the issue to implement it in future releases: Open the generated lib.php file in a text editor and find this line:

Code: Select all

@ini_set('session.serialize_handler', 'php');
Add the following code above it:

Code: Select all

@ini_set('session.gc_maxlifetime', 28800);
@session_set_cookie_params(28800);
This should keep the user signed in for up to 8 hours (8 hours * 3600 seconds per hour = 28800).

Re: Session timeout

Posted: 2016-09-30 07:19
by hendrik
Yesterday evening I made a first test with following changes and after a first check it seems to prolong the session time to 1h which I was looking for.
I modified the parameter "session.gc_maxlifetime = 3600” in file “/etc/php/7.0/apache2/php.ini”
Since you are proposing to modify same parameter it should work too I guess.
Thanks for reply

Re: Session timeout

Posted: 2017-04-09 15:00
by David
New to Appgini and was glad to have found this post. Added the two lines into lib.php as suggest by Ahmad and waited for the time-out to kick in. It did and took the screen back to the login prompt. Hope this will become a standard, configurable feature within AppGini for it being a common feature in the industrial-strength web app these days. Also we don't have to keep track of the customization manually.