NetTalk Central

Author Topic: I'm lost with Logout  (Read 4529 times)

Thomas

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
I'm lost with Logout
« on: April 22, 2008, 11:34:25 PM »
Hello,
please I need help !

my users sometimes must logout from the App und re-login with another account. I have a Logout button in a frame wich reloads the Login Page via URL call. The Relaunch of hte LoginPage works fine. But where to place the logout code ? And how to clear the Login Vars (have always the content of the previous Login) ?
 p_web.SetSessionValue( 'Loc:Login', '')
 p_web.SetSessionValue( 'Loc:Password', '')
 p_web.DeleteSessionValue( 'loc:login')
 p_web.DeleteSessionValue( 'loc:password')
 p_web.SetSessionLoggedIn( false)
 p_web.DeleteSession()
I tried a lot of places, I thought %CustomValidateEnd of the Logout Button would be correct... I cleared and SetSessionValue to '' or DeleteSessionValue immediatly after a successful Login would clear the Login Vars for a Relaunch... no it doesnt.

Any help appreciated.
TIA, Thomas

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: I'm lost with Logout
« Reply #1 on: April 23, 2008, 05:04:56 AM »
Login procedure
top of the GenerateForm routine should be a good place.

Cheers
Bruce

Thomas

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: I'm lost with Logout
« Reply #2 on: April 23, 2008, 05:41:51 AM »
Cool, many thanks !
(I'm sorry for lots of dumb questions - I have a deadline on Friday for a web based project, I'll show them a working example...)

additional questions to this:
1. I think the user remains after re-login within the same session... Can I "FREE" the session queue with one single method call ? Do I need other kind of housekeeping in this case ?

2. I have a Exit Button with 'javascript:top.close()'. How (and where) can I kill the Session before. I observed that after restart of the client some variables are not empty. I had to close/reopen the Webserver instead. In general: what is killing a Session - closing the Client App, closing the Browser, only closing the Webserver itself ?

TIA, Thomas.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: I'm lost with Logout
« Reply #3 on: April 23, 2008, 10:49:34 PM »
Hi Thomas,

No problem with the questions. Good luck with the demo. Alas I'm on leave on Friday so if you have late-breaking questions hopefully others will answer.

>> 1. I think the user remains after re-login within the same session...
yes, the log-in and logout does not change the session (this is by design.)

>> Can I "FREE" the session queue with one single method call ?
yes. Although theres no real need for you to do this. However if you want to then I'd do;
p_web.DeleteSession();
p_web.NewSession()

The second call might not be necessary, but I'd recommend it if the user is basically gonna carry on using the page.

>> Do I need other kind of housekeeping in this case ?

nope.

Cheers
Bruce