Page 1 of 3

nuBuilder - unwanted logout

Posted: Wed Jun 19, 2019 12:29 pm
by Janusz
Hi,
I am receiving often the message:
You must be logged into nuBuilder..
and I need to login again into nuBuilder to use it.

there are some posiibiliteis to set-up the Timeout in setup - but it looks - it does not affect or reduce that issue .

Do you have some experience with such issue - or maybe some workaround to minimise the unwanted logout?

Re: nuBuilder - unwanted logout

Posted: Wed Jun 19, 2019 2:23 pm
by kev1n
This "Timeout (minutes)" has been removed a while ago. It might help installing the latest version.

Re: nuBuilder - unwanted logout

Posted: Wed Jun 19, 2019 4:00 pm
by Janusz
Yes I know - this field stays on the old form - and it is not present on the recent one.
But anyway the value in the zzzz_.... table remains and is used by code later on with default value of 120minutes.
(The latest version is just removing the field to change this value from the form).
Concerning the php and java script files on the server I have the latest ones.

So general question if anyone is experiencing or not similar issues - maybe someone has some experience how to limit this.

It's not a blocking point at all to use nuBuilder - but it would be nice to have it limited.

Re: nuBuilder - unwanted logout

Posted: Fri Jun 21, 2019 10:54 am
by Janusz
FYI,
not sure for real cause but probably looks like some network connection disapperance, routing change or whatever happening after some time on idle by client computer.

Now I implementd a kind of cycling ping every one minute from nuBuilder client computer to cloud server - and so far issue is not appearing anymore.

Re: nuBuilder - unwanted logout

Posted: Fri Aug 23, 2019 9:56 am
by fpdragon
Janusz wrote:FYI,
not sure for real cause but probably looks like some network connection disapperance, routing change or whatever happening after some time on idle by client computer.

Now I implementd a kind of cycling ping every one minute from nuBuilder client computer to cloud server - and so far issue is not appearing anymore.
Could you post your solution please.
Thanks

Re: nuBuilder - unwanted logout

Posted: Fri Aug 23, 2019 8:27 pm
by Janusz
Hi,
In my case this solution works perfectly since several months with cloud server somewhere in the world.
Before that the database users had connections broken more than 10 times per day with a need to log again and again - currently they are working the whole day with one time login.
But this is not a plug and play solution and must be adjusted carefully to the database structure. In my case I have all forms inside iframes - if not there might be a problem.
So before implementing make a copy of DB - or the best check it on any non production test version of your database - because may happen that it stops to react.
So how is it implemented:
1. Client computer is sending every few minutes to the server via php procedure request to get time:
Procedure name: my_time (with just one line of code)

Code: Select all

 $teraz = date('Y-m-d H:i:s');
2. In header I have defined JS function to run it every few minutes

Code: Select all

function refreshServerConnection() {
x = 240;    //refresh ping in seconds
nuRunPHPHidden('my_time');
setTimeout(refreshServerConnection, x*1000);
}
var my_refresh=0;
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.

Re: nuBuilder - unwanted logout

Posted: Tue Aug 27, 2019 10:34 am
by fpdragon
Janusz wrote:Hi,
In my case this solution works perfectly since several months with cloud server somewhere in the world.
Before that the database users had connections broken more than 10 times per day with a need to log again and again - currently they are working the whole day with one time login.
But this is not a plug and play solution and must be adjusted carefully to the database structure. In my case I have all forms inside iframes - if not there might be a problem.
So before implementing make a copy of DB - or the best check it on any non production test version of your database - because may happen that it stops to react.
So how is it implemented:
1. Client computer is sending every few minutes to the server via php procedure request to get time:
Procedure name: my_time (with just one line of code)

Code: Select all

 $teraz = date('Y-m-d H:i:s');
2. In header I have defined JS function to run it every few minutes

Code: Select all

function refreshServerConnection() {
x = 240;    //refresh ping in seconds
nuRunPHPHidden('my_time');
setTimeout(refreshServerConnection, x*1000);
}
var my_refresh=0;
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.

Thank you very much for your answer.

I understand what you were doing with the work around solution but I'm currently not so familiar with "php procedures". If I understood correctly then this is a defined function on php server side that can be triggered. In the end the "nuRunPHPHidden" triggers php procedures on the server from the browser JavaScript context. This forces a communication (ping).
But I am having troubles in finding out how I should define such a procedure.
In phpMyAdmin I found out that I can define Procedures by following these steps:
*) changing to the DB
*) click on "Procedures" tab
*) click on "Add Procedure"
But here I have the problem that it seems that the tool only allows SQL syntax for the procedure definition. Even if "NO SQL" is selected.

Where do I have to define this php procedure?
Can't I use just an other php function like getdate()?

Thanks

Re: nuBuilder - unwanted logout

Posted: Tue Aug 27, 2019 2:31 pm
by kev1n
The procedure can be added here:

Tab Builder -> Procedure -> Build Procedure -> Button Add
procedure.png

Re: nuBuilder - unwanted logout

Posted: Tue Aug 27, 2019 2:46 pm
by Janusz
fpdragon,
and, by the way - how often do you experiece similar issue?
is it on the local network or with remote server?

Re: nuBuilder - unwanted logout

Posted: Tue Aug 27, 2019 3:05 pm
by fpdragon
kev1n wrote:The procedure can be added here:

Tab Builder -> Procedure -> Build Procedure -> Button Add
procedure.png
ahhhh...

I see.
Thank you.

Now I am testing.