NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Matthew51 on November 29, 2018, 01:43:33 PM

Title: Load page on session timeout
Post by: Matthew51 on November 29, 2018, 01:43:33 PM
NT: 10.36

In your NT 11 webinars you had one of your examples load a new page after the session timed out.  I can't see anywhere do do this in the documentation.  Is this new in NT 11 or do those of us still on NT 10 have it?
Title: Re: Load page on session timeout
Post by: Bruce on November 29, 2018, 11:52:48 PM
You have it in NT10.
The code goes into the PageFooterTag procedure in the Processes Code embed point.
(If you wizard up a new app it'll go in there.)

    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.DefaultPage) &'","countdown");')
    end