Describe the different properties of cookie in Asp.Net?

 Posted by Tripati_tutu on 11/2/2010 | Category: ASP.NET Interview questions | Views: 3506 | Points: 40

The different properties of a cookie are:

Domain: This property defines the domain of Web servers to which this cookie should be made available. When the Web server matches the defined domain then that web browser will send a cookie back to a Web server. It specifies the domain for which the cookie is valid. The domain associated with the cookie for example,

Expires: It specifies the expiration date for a persistent cookie. It sets the current state of the cookie. Also it gets and sets the expiration date and time for the cookies.

HasKeys: This is a Boolean value which indicates whether the cookie is a cookie dictionary or not.

Name: The name of the cookie.

Path: It defines a Web server path to which the cookie should be made available. The path associated with the Cookie that is it sets the URI's to which the cookie applies. The default value is /.

Secure: A value that indicates whether the cookie should be sent over an encrypted connection only. It sets the Secure attribute of any SESSIONID cookies associated with the web application. It allows values as:
true — Sets Secure to true.
false — Sets Secure to false.
dynamic — The SESSIONID cookie inherits the Secure setting of the request that initiated the session. The default value is False.

Value: The value of the Cookie that is it sets the value for the cookie.

Values: It is a NameValueCollection that represents all the key and value pairs stored in a Cookie dictionary.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response