Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuBuilder - unwanted logout

Questions related to using nuBuilder Forte.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: nuBuilder - unwanted logout

Unread post by Janusz »

Normally in header should be fine. It has to be just started in one place.
additonally in code the following : nuRunPHPHidden('my_time');
should be replaced by: nuRunPHPHidden('my_time','x');
If you like nuBuilder, please leave a review on SourceForge
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nuBuilder - unwanted logout

Unread post by treed »

Here is some info about settings in your PHP.INI file.
PHP and sessions: Very simple to use, but not as simple to understand as we might want to think.

session.gc_maxlifetime
This value (default 1440 seconds) defines how long an unused PHP session will be kept alive. For example: A user logs in, browses through your application or web site, for hours, for days. No problem. As long as the time between his clicks never exceed 1440 seconds. It's a timeout value.

PHP's session garbage collector runs with a probability defined by session.gc_probability divided by session.gc_divisor. By default this is 1/100, which means that above timeout value is checked with a probability of 1 in 100.

session.cookie_lifetime
This value (default 0, which means until the browser's next restart) defines how long (in seconds) a session cookie will live. Sounds similar to session.gc_maxlifetime, but it's a completely different approach. This value indirectly defines the "absolute" maximum lifetime of a session, whether the user is active or not. If this value is set to 60, every session ends after an hour.
So PHPINFO.PHP reported the default value of session.gc_maxlifetime at 1440 seconds for my system. I've upped this to 14400, at that point users deserve to be logged out. We'll see if it works.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nuBuilder - unwanted logout

Unread post by treed »

This appears to have worked!
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: nuBuilder - unwanted logout

Unread post by Janusz »

For sure this setting can help.
In my case I have default values 1440 (24minutes).
Even though very often I observed that connection was lost even after some minutes.

From my observation it can change from network to network and can be related as well to network routers settings.
For example when I open Linux terminal to the same server from one network I can have it active for hours.
but with the same configuration from the other network I can have connection broken after some minutes of inactivity - but sometimes can stay long connected.
If you like nuBuilder, please leave a review on SourceForge
Post Reply