NetTalk Central

Author Topic: Log out issue with NT7 app  (Read 3704 times)

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Log out issue with NT7 app
« on: December 19, 2012, 07:45:00 PM »
Bruce,

     I find that when the session times out, my login form appears as it should but my TaskPanel menu stays on screen.  The session timer is blank at this point.  If I select a menu item, it fires and the session timer starts again.  I tried adding the following to the WebHandler DeleteSession embed:

p_web.SetSessionLoggedIn(0)

     I use the JavaScript method on my Logout menu item.  If the above code is used, then this no longer works and causes the MultiSite host to crash.

     It seems the log out process has changed with NT7, and NT6 converted apps like mine don't log out as they did before.  Can you elaborate on the changes and how to fix this?

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Log out issue with NT7 app
« Reply #1 on: December 21, 2012, 12:38:02 AM »
>>  should but my TaskPanel menu stays on screen.

what code do you have that makes you feel it should vanish?

Perhaps a good approach would be to make a conditional menu based on what page you're on? See for example the Page Header tab in example 3?

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Log out issue with NT7 app
« Reply #2 on: December 21, 2012, 12:35:36 PM »
Bruce,

     I feel the menu should vanish since I have set the check box, "User must be Logged In".  This implies the menu will show only if the user is logged in.  
     So, since the menu still shows after the session timer has expired, it seems the user has not been logged out at this point.  Can you verify, that when the session timer expires, is the user logged out?  Also, is the session deleted when the session timer expires?

     I have experimented with the conditional menu technique you suggested.  It does cause the menu to go away when the session expires, but I'm concerned that the user has still not been logged out at this point.
     In my NT6 version of this app, all menus disappeared when the session timer expired.  I think this is because the login form appears at this point, and in the GenerateForm, Start embed of the Login Form we have the following code:

p_web.SetSessionLoggedIn(0)

     So the user was logged out at this point and the "User must be Logged In" setting did the job and turned off the menus.  But as discussed in a previous post, this line of code is no longer usable in NT7 apps as it prevents users from logging in.

     To summarize, I want to log users out when the session timer expires.  If this is not normally done, is there a way to make this happen?

Thanks,

Jeff
« Last Edit: December 21, 2012, 12:37:28 PM by kingja »

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Log out issue with NT7 app
« Reply #3 on: December 21, 2012, 01:11:04 PM »
Bruce,

     Just discovered something interesting.  When the session timer expires the screen shown in attached image before_refresh.png is seen.  If I refresh the browser I then see the image after_refresh.png.  The last image is the screen I expect, with the menu gone, user logged out and session expired.  Seems a refresh is needed just after the sesion timer expires.  Is the a way to do this?

Thanks,

Jeff

[attachment deleted by admin]

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Work around Re: Log out issue with NT7 app
« Reply #4 on: December 22, 2012, 10:33:55 AM »
OK...I have been able to workaround this issue.  First, as Bruce suggested, I added a condition to display each menu item: 

              p_web.GetSessionLoggedIn() = 1 and p_web.PageName <> 'LoginForm'

Then, in the GenerateForm, Start embed I have the following:

              If p_web.GetSessionLoggedIn() = 1
                      p_web.SetSessionLoggedIn(0)
              END

The  first bit of code serves to hide the menus if the login form is displayed.  The second bit of code explicitly does a log out if the login form appears.  So now I have the effect I had in the NT 6 version of the app.

Thanks,

Jeff