User.Identity.Name

  • Thread starter Thread starter Nedu N
  • Start date Start date
N

Nedu N

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
 
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.)
 
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 said:
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.
 
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.)
 
Back
Top