NetTalk Central

Author Topic: Status after a Web Server timeout  (Read 3702 times)

hkalmbach

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Email
Status after a Web Server timeout
« 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

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Status after a Web Server timeout
« Reply #1 on: May 02, 2016, 09:43:09 PM »
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.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

hkalmbach

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Email
Re: Status after a Web Server timeout
« Reply #2 on: May 03, 2016, 12:13:51 AM »
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

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Status after a Web Server timeout
« Reply #3 on: May 03, 2016, 12:48:56 AM »
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)
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186