views:

34

answers:

2

If the login code int
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthenticationticket(v=VS.90).aspx
we will found that they create cookie as below

new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)

I want in another code to read this cookie and check it .. how can i do although i don't know the name of the cookie ?

A: 
  • you can change the name of the forms authentication cookie in the web.config for your ASP.NET application.
  • your code doesn't need to know the exact cookie name. You can use the FormsAuthentication.FormsCookieName property instead.
Franci Penov
A: 

You have the answer in your example, the cookie is named by the value contained in:

FormsAuthentication.FormsCookieName

Paul Hadfield