Session timeout

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
hendrik
Posts: 2
Joined: 2016-09-23 10:20

Session timeout

Post by hendrik » 2016-09-23 11:03

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

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Session timeout

Post by a.gneady » 2016-09-29 12:21

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).
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

hendrik
Posts: 2
Joined: 2016-09-23 10:20

Re: Session timeout

Post by hendrik » 2016-09-30 07:19

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

David
Posts: 4
Joined: 2017-03-12 09:15

Re: Session timeout

Post by David » 2017-04-09 15:00

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.

Post Reply