Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is ASPXAUTH cookie?

While working with ASP.Net Forms Authentication I came across the .ASPXAUTH cookie. I have a couple questions:

  • What is the purpose of this cookie?
  • What is the location of this cookie?
like image 559
balaweblog Avatar asked Jan 08 '09 06:01

balaweblog


People also ask

What does ASP Net_SessionId cookie do?

Net_SessionId is a cookie which is used to identify the users session on the server. The session being an area on the server which can be used to store data in between http requests.

How does FormsAuthentication SetAuthCookie work?

The SetAuthCookie method adds a forms-authentication ticket to either the cookies collection or the URL if CookiesSupported is false . The forms-authentication ticket supplies forms-authentication information to the next request made by the browser.

What is FormsAuthenticationTicket?

FormsAuthenticationTicket(Int32, String, DateTime, DateTime, Boolean, String, String) Initializes a new instance of the FormsAuthenticationTicket class with cookie name, version, directory path, issue date, expiration date, persistence, and user-defined data.

What is FormsAuthentication FormsCookieName?

Remarks. The FormsCookieName property value is set in the configuration file for an ASP.NET application by using the name attribute of the forms configuration element. The FormsCookieName is used to reference the cookie that stores the FormsAuthenticationTicket information.


1 Answers

The ASPXAUTH cookie is used to determine if a user is authenticated.

As far as the location of the cookie, that depends on your browser. If you are using Firefox you can view the cookie by clicking on Tools -> Options -> Privacy. Then scroll down to the domain and expand it to see the cookie and its value. The value is encrypted using the machine key (located in the server's machine.config or web.config file) so looking at the cookie on the client won't really provide you any information. You can decrypt/view the value on the server side using:

HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];//.ASPXAUTH FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); 

where authTicket has these fields:

enter image description here

The statement "ASPXAUTH is basically used to maintain ASP.NET Session State" is incorrect. ASP.NET issues an entirely different cookie, named ASP.NET_SessionId, to track session state.

like image 113
Todd Avatar answered Sep 28 '22 03:09

Todd