467,136 Members | 1,393 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,136 developers. It's quick & easy.

Retrieving Forms Authentication Cookie

Hi,

Quick question:

I have set a persistent cookie on my login page and have the following
in the web config.

<forms name="BeanAppAuth" loginUrl="Login.aspx" protection="All" />

I know I can do this:

Dim objUserIdentity As FormsIdentity
If User.Identity.IsAuthenticated Then
objUserIdentity = User.Identity
Response.Write(objUserIdentity.Name)
End If

To get the username but how do I do this via the cookie name??
Response.Cookies("BeanAppAuth").Value ??

Thanks

Angela
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
  • viewed: 1222
Share:
1 Reply
What are you trying to do? The username is encrypted inside of the cookie,
so the way ASP.NET presents this to your code is to make User.Identity.Name
avaialble as a public API from your page.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

Quick question:

I have set a persistent cookie on my login page and have the following
in the web config.

<forms name="BeanAppAuth" loginUrl="Login.aspx" protection="All" />

I know I can do this:

Dim objUserIdentity As FormsIdentity
If User.Identity.IsAuthenticated Then
objUserIdentity = User.Identity
Response.Write(objUserIdentity.Name)
End If
To get the username but how do I do this via the cookie name??
Response.Cookies("BeanAppAuth").Value ??

Thanks

Angela

*** Sent via Developersdex http://www.developersdex.com ***


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by ElmoWatson | last post: by
1 post views Thread by Scott | last post: by
3 posts views Thread by Martin | last post: by
reply views Thread by Anonieko Ramos | last post: by
5 posts views Thread by Gavin Stevens | last post: by
1 post views Thread by Mark Olbert | last post: by
8 posts views Thread by =?Utf-8?B?TFc=?= | last post: by
4 posts views Thread by =?Utf-8?B?R3V1czEyMw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.