63
Views
6
Comments
Solved
Keep session open
Question
Application Type
Reactive

Hi,

I have an application which allows users to add notes to a log.  It works fine unless a user keeps the application open for about an hour with no activity.  When this happens, the users enters a note and upon clicking save the session resets and the notes are lost.

I did find one thread on here where someone had a similar issue but none of the links to the solutions work anymore.

Any advice appreciated.

Thanks

2021-10-07 07-03-31
Vo Ton Phuc
Solution

You can use either OnInitialize or OnReady event of screen. Using JavaScript node in that. Inside the JS, you can call screen action directly by $action.<Your screen action name>

2021-10-07 07-03-31
Vo Ton Phuc

You can do a trick like that, Create a temp server action and create a javascript send request to that server action silently by interval time.

2022-09-04 15-01-10
JayPea

Thanks, would the temp server action just have a start and end node but not actually do anything? Would that be enough to stop the session timing out?

2021-10-07 07-03-31
Vo Ton Phuc

For fake request to server to trigger that browser is still connect and interaction with server to keep using sessions purpose only, so I think start and end node is enough. Or just take some log to ensures that it is working or not?

2022-09-04 15-01-10
JayPea

Thank you another question. I've testes adding my JS to the Script section in the script section and to test it I just had it display and alert and it worked.

Now what I want to do is have my JS call a screen action as I don't think I can call a server action directly.

This is the JS:

I thought that I could call my screen action as shown above but it doesn't work and I get a warning so say the KeepFormAlive client action is not being used.

How would i call my screen action?


2021-10-07 07-03-31
Vo Ton Phuc
Solution

You can use either OnInitialize or OnReady event of screen. Using JavaScript node in that. Inside the JS, you can call screen action directly by $action.<Your screen action name>

2022-09-04 15-01-10
JayPea
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.