NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Jane on March 15, 2014, 02:30:20 PM
-
Wise ones,
What's a graceful way to let a user know that his session has timed out?
My bank, for example, starts popping up "if you're idle for two more minutes you'll be logged off" messages.
Then bounces to a login page once they've killed the session.
For a site that doesn't require a login, I'd like to switch to a "need to reconnect" page when it's timed out.
Otherwise people (such as me) try clicking buttons on the screen 20 minutes later and nothing happens.
Is there something in the NT examples showing this sort of thing... or a thread you can point me at?
Or a suggested approach?
TIA
Jane
-
If you wizard up a new footer procedure you'll see embed code in it something like this;
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
This shows a countdown in the footer - which can then re-direct a user to a page (in this case the login page).
Cheers
Bruce
-
Way cool.
I'm not using a login for this app, but this gives me some good options.
Thanks, Bruce!
Jane
-
How do I wizard up a new footer procedure ?
I'tried multiple ways but this code never happens
thanks
NT8
-
Hi Jane
Did you make progress with this? I was going to ask the same question as in my application after a session has times out and a user tries to do something new then weird things happen and its not very graceful.
Cheers
Keith
-
>> How do I wizard up a new footer procedure ?
easiest is to wizard up a new app, based on say one of the example dictionaries, and just pinch it from there.
Keith, you'll find the code in there.
cheers
Bruce
-
Cool, but ...
I´m using translate to translate the text and the footer does not respect the áéíóú
see image
Any idea?
[attachment deleted by admin]
-
Hi.
I see that it worked for Michelis but I wizarded up an app and after login nothing appears in the footer. Any settings I missed? see attached.
OK I see the login screen is called after the timeout period but like Michelis I would like to display the time till logout.
[attachment deleted by admin]
-
terryd, there is a check in the wizard to do it, may be you missed it.
Anyway the result is very simple
Add this code ib the Proceced Code embed of the Footer proc:
[DEFINITION]
[SOURCE]
PROPERTY:BEGIN
PRIORITY 2500
PROPERTY:END
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
[END]
And go to the XHTML tab and add something like:
<div>Copyright <!-- Net:d:year --></div>
<div class="nt-right nt-countdown">Session Expires In:<div id="countdown"></div></div>
at Top, with condition= p_web.GetSessionLoggedIn()
And thats it.
Cheers
-
Thanks Michelis
Worked fine
-
Please Bruce Why is this happening?
I´m using translate to translate the text and the footer does not respect the áéíóú
see image
Any idea?
[attachment deleted by admin]