Working with Cookies
Request and Response Mastery · Created 2026-06-01 13:34:28
Store small data on the client side using cookies.
Reading Cookies
Dim val
val = Request.Cookies('theme')
Writing Cookies
Response.Cookies('theme') = 'dark'
Response.Cookies('theme').Expires = Date() + 30
Response.Cookies('theme').Path = '/'
Response.Cookies('theme').HttpOnly = True
Subkeys
Response.Cookies('user')('name') = 'Alice'
For Each n In Request.Cookies('user')
Response.Write n & '=' & Request.Cookies('user')(n)
Next
ASPPY Note
ASP_PY_SESSIONID is set automatically for sessions.
Reading Cookies
Dim val
val = Request.Cookies('theme')
Writing Cookies
Response.Cookies('theme') = 'dark'
Response.Cookies('theme').Expires = Date() + 30
Response.Cookies('theme').Path = '/'
Response.Cookies('theme').HttpOnly = True
Subkeys
Response.Cookies('user')('name') = 'Alice'
For Each n In Request.Cookies('user')
Response.Write n & '=' & Request.Cookies('user')(n)
Next
ASPPY Note
ASP_PY_SESSIONID is set automatically for sessions.