user.identity? shows after log out....

Last post 07-06-2005 3:59 AM by WebD. 4 replies.

Sort Posts:

  • user.identity? shows after log out....

    09-20-2004, 9:06 PM
    • Contributor
      2,865 point Contributor
    • WebD
    • Member since 08-12-2002, 8:13 PM
    • Glendale, CA USA
    • Posts 596
    Hello:

    I have noticed that if you log a user out... the first page redirected to after login still shows the user credentials as if the user is still logged in... So after logout a user is forwarded to a page with this code: response.write(user.identity.name), it will output the name when infact the user logged out to get to this page. But just for the first page, after navigating to another page it is no longer available... anyone ever get this?
  • Re: user.identity? shows after log out....

    09-21-2004, 5:44 AM
    • Star
      8,255 point Star
    • bdesmet
    • Member since 08-04-2002, 10:39 AM
    • Belgium
    • Posts 1,651
    Does the IsAuthenticated property of the user's identity tell you the user is still authenticated or not? In fact it shouldn't do this, but if it does it can help us to find the problem. To check whether a user is logged in or not, you should always check the IsAuthenticated property first.
    Bart De Smet [MVP]



    Visit www.msdn.be, www.bartdesmet.net
  • Re: user.identity? shows after log out....

    09-21-2004, 4:43 PM
    • Contributor
      2,865 point Contributor
    • WebD
    • Member since 08-12-2002, 8:13 PM
    • Glendale, CA USA
    • Posts 596
    Yes I have checked the IsAuthenticated Property and it says that it is actually authenticated.

    The way I sign a user out is by redirected them to the home page of the site. On page_load it checks for a query string called signoff, if available it logs the user off. Then the following code is ran:

    formsauthentication.signout()
    response.write(user.identity.isauthenticated)

    So first the user is logged off, then it is printed on the screen wether or not the user is still logged in. The print value is "True." But after reloading the page or visiting another page, the value goes back to "False." Very strange... I do not want to say that it is a bug yet...
  • Hmm [^o)] Re: user.identity? shows after log out....

    07-06-2005, 12:38 AM
    • Member
      55 point Member
    • SynerSoft
    • Member since 06-24-2002, 7:58 PM
    • Posts 13
    I have the same problem.  Did you ever find a solution or discover what was causing the logout to fail or the 'IsAuthenticated' to mis-report?

    -Jay

    Dreaming of a stable layout designer..
  • Re: user.identity? shows after log out....

    07-06-2005, 3:59 AM
    • Contributor
      2,865 point Contributor
    • WebD
    • Member since 08-12-2002, 8:13 PM
    • Glendale, CA USA
    • Posts 596
    Hello:

    I got a work around to this problem which is really simple. 

          formsauthentication.signout()
          session.abandon()
          response.redirect("login.aspx")

    It is very sufficient... Have a good day.
Page 1 of 1 (5 items)