User.Identity.Name

Discussion in 'ASP .Net' started by Nedu N, Dec 8, 2003.

  1. Nedu N

    Nedu N Guest

    Hi,

    I am using Forms authentication -in which -
    I am trying to use User.Identity.Name, i am getting the user name in this
    field even after i logout (i.e, FormaAuthentication.SighnOut(),
    and also i am trying to use User.Identity.IsAuthenticated for checking
    whether the User has logged in or not.

    I don't want to store the user name in Session variable once the User logs
    in.

    I want to make use of User object properties for getting to know the uswr
    name and whether user has logged in or not.

    Is this possible?

    Thanks
    Nedu
     
    Nedu N, Dec 8, 2003
    #1
    1. Advertisements

  2. Nedu N

    MSFT Guest

    Hi Nedu,

    SignOut method will remove the cookie item related to form authentication,
    and this will be effect for next request. For current request ( when you
    call SignOut), User.Identity is still valid.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Dec 9, 2003
    #2
    1. Advertisements

  3. Nedu N

    Nedu N Guest

    Thanks Luke,
    I am planning to use User.Identity.Name property for the user name who
    logged into my application, is this okay or i have userid captured in the
    session variable?
    I was trying to use User.Identity.IsAuthenticated for checking session
    timeout, but as per your answer it is not so.
    I was thinking once the SignOut() method is called then the these
    User.Identity properties will be discarded., please clear me in this regard.
     
    Nedu N, Dec 9, 2003
    #3
  4. Nedu N

    Nedu N Guest

     
    Nedu N, Dec 9, 2003
    #4
  5. Nedu N

    MSFT Guest

    Hi Nedu,

    User.Identity.IsAuthenticated is also changed on next request. I think a
    session variant may be a work around for this problem, you can set User
    ID/Name to the session variant after he is authenticated and set it to NULL
    after calling SignOut method.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Dec 10, 2003
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.