<%@ Language=VBScript %> <% option explicit %> <% dim getcookie getcookie = "" dim cookiecounter cookiecounter = 0 dim item, itemkey for each item in request.cookies if request.cookies(item).haskeys then for each itemkey in request.cookies(item) getcookie = getcookie & itemkey & " is " & request.cookies(item)(itemkey) & "
" if itemkey = "COUNTER" then cookiecounter = cint(request.cookies(item)(itemkey)) next end if next 'the following will delete the cookie... 'response.cookies("DVDemoCookie").expires = date() - 1 dim cookietext cookietext = request.form("cookietext") if cookietext = "" then cookietext = "No message was left!!" response.cookies("DVDemoCookie")("message") = cookietext response.cookies("DVDemoCookie")("mdate") = date() response.cookies("DVDemoCookie")("mtime") = time() response.cookies("DVDemoCookie")("counter") = cookiecounter + 1 %> ASP Cookie Demo

Cookie Demo

 

If we found the cookie already here, it said...
<% response.write(getcookie) %>

 

Enter the following to be placed in a cookie...