NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: hkalmbach on May 01, 2016, 11:53:24 PM
-
Hello,
I am not sure how to handle a Web Server timeout correctly.
The situation is, a user opens a form to edit some record, goes away and the timeout occurs.
When he comes back he does not know about the timeout until he clicks on a button or something else.
The he is redirected to the login form. If he has logged in he is redirected back to the form where he left.
But there he gets the following error:
1. Record not found: (-2) Error 30
What do I have to do, that the user does not automatically is directed to the last form after logging in again, but instead has to take the way he normally does when logging in the first time?
Thanks
Heinz
-
Hi Heinz
If you use the startCountdown code which is placed in the footer Processed Code embed then once the countdown is complete it will return to the login screen (i.e parameter2)
! p_web._trace('sessionloggedin ' & p_web.GetSessionLoggedIn() & ' wabpagename ' & p_web.PageName)
if (p_web.GetSessionLoggedIn() and p_web.PageName <> p_web.site.LoginPage)
! parameter 1 is the session time
! parameter 2 is the name of the login page.
! parameter 3 is the id of the <div> in the html.
p_web.Script('startCountDown('& int(p_web.site.SessionExpiryAfterHS/100) &',"'& clip(p_web.site.LoginPage) &'","countdown");')
end
Give me a shout if you have not used it before.
-
Hi Terry,
thanks for your answer.
No I don't know the startCountdown code.
I am not sure if I understand it.
In which procedure it should be placed? All pages?
The use of the variables is also not clear, where das webpagename gets its value?
Do you mean with LoginPage the page where the user really enters his user account or the page where he should be directed afterwards (normally the main menu of the app).
Thanks for some additional hints.
Cheers
Heinz
-
Hi Heinz
The code I posted gets placed in the Processed Code embed of your PageFooterTag.
It doesn't need to be anywhere else.
In the xHTML tab of the footer put this:
<div class="nt-right nt-countdown">Session Expires In:<div id="countdown"></div></div>
</div>
What should happen is that once the user is logged in a countdown will display in the footer. When he stops entering the countdown start. If he enters the countdown resets.
Once the countdown reaches zero the user will be logged off and returned to the login screen (see attached)