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 4 5419
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.
"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.)
"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.)
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.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 content based on the user's role. I
wrote this to do it:
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
plLoggedIn.Visible = true;
|
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:
Web.HttpContext.Current.User.Identity.Name
to write audit trail as to what users do. Now recently on one of the
activities I noticed that the
|
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
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
|
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 login id in other forms of the
app. I will eventually save a record to a SQL database, and I want the login
id to be automatically entered in a...
|
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 HttpContext.Current.User.Identity.Name
returns the correctly logged on user.
However, 10% of the time (I'm guessing under stress conditions or
simulataneous...
| |
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 User.Identity.Name !
But i want to pass(the current user) to a table in DB!
I was thinking of ussing hidden textboxes like so :-
Is it a good...
|
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 runat="server">
void Page_Load(Object Sender, EventArgs E)
{
|
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 current user to a role like so:
<script runat="server">
void Page_Load()
|
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 page and try to
access that cookie. However, because I am using
HttpContext.Current.User.Identity.Name to get the user id to know what
that cookie...
|
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 article:
http://support.microsoft.com/?id=306158#4
This doesn't work in Windows 2008 Server, we receive the following exception:
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |