Open In App

ASP Request.Cookies Collection

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. 



Syntax:

Request.Cookies( cookie )[(key)|**.**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.Cookies("site")="GeeksforGeeks"
sname=Request.Cookies("site")
response.write("Grow with " & sname)
%>

Output:

Grow with GeeksforGeeks
Article Tags :