473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

User.Identity.Name

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
Nov 18 '05 #1
4 5408
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.)

Nov 18 '05 #2
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.

"MSFT" <lu******@online.microsoft.com> wrote in message
news:xI**************@cpmsftngxa07.phx.gbl...
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.)

Nov 18 '05 #3

"Nedu N" <ne****@hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
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.


"MSFT" <lu******@online.microsoft.com> wrote in message
news:xI**************@cpmsftngxa07.phx.gbl...
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.)


Nov 18 '05 #4
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.)

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
15
by: Tom Nowak | last post by:
I am writing a webapp in which a user is required to enter a login id and password on a login form. I have forms authenticaion coded in my web.config. Once the user is logged in, I want to use the...
10
by: kiran_s_rao | last post by:
I have a serious issue that seems to be intermittent with User.Identity.Name. In an environment where about 100+ users are logging on to a site with forms authentication, calling ...
3
by: Patrick Olurotimi Ige | last post by:
How can i send LOGON_USER or User.Identity.Name to the Database? I'm working on a survey which is intranet based with Windows Authentication. I can get the current user by calling LOGON_USER or...
2
by: Abraham Andres Luna | last post by:
hello everyone, does anyone know why i can't access the HttpContext.Current.User.Identity.Name property in a .cs file? this is the index.aspx page: <%@ Page Language="C#" %> <script...
3
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
hi folks, I've got XP pro service pack 2 VS 2005 TSE with ASP.net 2.0 and C# I'm doing an example from Stephen Walther's so far excellent book and he has a whole load of stuff to add the...
4
by: Doogie | last post by:
Hi, I am using HttpContext.Current.User.Identity.Name to get a user id from a web application. I then use that as part of a name of a cookie I'm writing. 30 minutes later I do a refresh of this...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.