Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

ASP Request.Cookies Collection

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Basically Cookies are small files that are stored on a user’s computer. They are used to hold a modest amount of data specific to a particular client and website and can be accessed either by the web server or by the client computer.  

The Request.Cookies Collection is used for returning the value of the collection of the cookies. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value, and the old value is discarded. 


Request.Cookies( cookie )[(key)|**.**attribute]


  • Name: It specifies the name for the Cookies.
  • Key: It is not an optional parameter represents a key value for the cookies.
  • Attribute: It specifies the information about the cookies . The attribute parameter can be one of the following.
    1. Domain: Write-only. It specifies the cookie sent only to the requests domain name.
    2. Expires: It specifies the expiry date of the cookies. If the data is not set, then the cookies will expire after the session ends.
    3. HasKeys: Read-only. It specifies whether the cookie contains keys or not.
    4. Path: Write-only. If specified, the Cookie is sent only to requests to this path. If this attribute is not set, the application path is used.
    5. Secure: write-only. It represents that the cookies are secured.
  • Value: It defines a value that is assigned to the key or attribute.

Example: Basically “Request.Cookies” command is used to get a cookie value. Below code illustrates that how to return the value of cookies named as “firstname”.

response.write("Grow with " & sname)


Grow with GeeksforGeeks
My Personal Notes arrow_drop_up
Last Updated : 24 Mar, 2021
Like Article
Save Article
Similar Reads
Related Tutorials