Page 2 of 3
Re: nuBuilder - unwanted logout
Posted: Tue Aug 27, 2019 3:11 pm
by fpdragon
Janusz wrote:fpdragon,
and, by the way - how often do you experiece similar issue?
is it on the local network or with remote server?
The issue happens on the local network but in different v-lans.
I'm not sure but I think something between 30 minutes and 2 hours no use the disconnect happens. The main problem is that the user is not notified that he/she got logged out. So it happens that one likes to enter data in the current form and when "save" is pressed everything just entered is lost.
I expect that a network device (switch, firewall, ...) is the cause of the problem. However I still need a workaround on nuBuilder level to at least detect the disconnect.
Re: nuBuilder - unwanted logout
Posted: Tue Aug 27, 2019 3:42 pm
by Janusz
additionally make sure that your computers are not going to quick into sleep mode - this will cause connection loose as well.
On my computers I keep - go to sleep after 2h (monitor off can be set to any value).
Keep in mind that your forms must be inside iframes if not the save buttons on the forms will go to red (it was at least in my case)
Let us know the status after implementing this solution and after some time of verification.
Re: nuBuilder - unwanted logout
Posted: Mon Sep 02, 2019 9:29 am
by fpdragon
Hello.
I have an update.
I added the procedure and added the JavaScript code to the index.php file in the <head> section.
No JavaScript errors in the browser's debug console.
But still, after waiting some time I got logged out without seeing something on the website. I have to navigate to an other site or press on save to get the error message that I'm not logged in.
So the workarround is still not working.
To the other questions: I took care of that my computer does not go to sleep. I expect that the connection drops are caused by a network device but I don't think that this problem will be solved in short time. So I need a workaround.
Just for understanding:
every nuBuilder session login is dropped when the tcp ip connection is closed? Is there a way to keep sessions open, even if the connection is lost? Just like most of the website does like google and co. My login is kept even if the turn off my pc or the connection is lost.
Re: nuBuilder - unwanted logout
Posted: Mon Sep 02, 2019 10:02 am
by Janusz
Concerning the:
Code: Select all
if (my_refresh===0) {refreshServerConnection(); my_refresh++;}
$('#FF_refresh').val(my_refresh);
is it placed in the custome code JS on the:
nuuserhome
form?
Re: nuBuilder - unwanted logout
Posted: Tue Sep 03, 2019 3:28 am
by Janusz
and to verify if the php procedure is working in cycling mode you can add nuDebug as following:
Code: Select all
$teraz = date('Y-m-d H:i:s');
nuDebug($teraz);
and check in debug if time is recorded every some minutes.
Re: nuBuilder - unwanted logout
Posted: Tue Sep 03, 2019 9:53 am
by fpdragon
Thank you.
I added the JavaScript code directly to the index.php file. Does it really make any difference if you add the code to the nuuserhome form?
I added the debug command the the php procedure.
In zzzzsys_debug I get cyclic entries so I guess the code is executed correctly.
No idea why I still get logged out without seeing any message.
Re: nuBuilder - unwanted logout
Posted: Tue Sep 03, 2019 4:35 pm
by Janusz
I added the JavaScript code directly to the index.php file. Does it really make any difference if you add the code to the nuuserhome form?
if you can see the cycling time record in the Debug from code point of view it's OK.
From my side I have no more ideas what can be done more.
Now I am 7000km away from my home (and from my server) and I can use my databases with no issues - so probaly you must verify something internally with the network.
Maybe you can try as well to set in apache2 server the time out to much higher values if small number of people is using that server.
/etc/apache2/apache2.conf
# Timeout 300
Timeout .....
#KeepAliveTimeout 5
KeepAliveTimeout .....
but if it helps or have other negative impact on the system I do not know - but if you have no other choice maybe you can try.
https://stackoverflow.com/questions/566 ... nd-timeout
Re: nuBuilder - unwanted logout
Posted: Wed Oct 14, 2020 7:46 am
by kev1n
Janusz wrote:
3. The JS function is stared from the main form of database with following code:
Code: Select all
if (my_refresh===0) {refreshServerConnection(); my_refresh++;}
and this is the whole setting.
Can't you start it in the (Setup ->) header directly or is there any drawback?
Re: nuBuilder - unwanted logout
Posted: Wed Oct 14, 2020 9:43 am
by Janusz
It was probably that when you login as globeadmin it does not start immidiatelly - so it's easier to test and set-up. It starts when you enter "User Home".
For normal user it makes no difference - it starts immidiatelly after login.
Re: nuBuilder - unwanted logout
Posted: Wed Oct 14, 2020 9:45 am
by kev1n
The thing is, if you log in passing another form id (not userhome), e.g. /nubuilder/index.php?f=5ac594150f25e50, the timer won't start. Therefore I thought it's better to place the timer code in the header and not in a form.