User.Identity.Name

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
 
M

MSFT

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.)
 
N

Nedu N

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.
 
N

Nedu N

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.
 
M

MSFT

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.)
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top