|
Setting / Retrieving Cookies
| Language: |
ASP |
  
Rated by 3 Users
1 Star = Horrible 5 Stars = Perfect
Rate Code Now
|
| Posted By: |
keith |
| Author Website: |
asp or php |
| Posted On: |
6/20/2007 |
| Code Views: |
2439 |
This shows how to save and retrieve cookies in ASP. Also shows how to set an expiration date.
|
<% ' Saving Cookies:
' Write a cookies, with the name "User" and value "Tom": Response.Cookies("User") = "Tom"
' Set the expiration date to 30 days from now: Response.Cookies("User").Expires = Date() + 30 %>
<% ' Displaying Cookies:
' Write the cookie value to the page: Response.Write(Request.Cookies("User"))
%>
View code in Textarea
This code has not been tested by Your WebCode. Use it at your own risk.
Please report any copyright violations.
|
|