ASP

ASP Variables Strings Form Arrays 2D Array Loop IF Cookies Dates Dictionaries SQL Numbers Files JSON Database Regular Expression ExecuteGlobal Recordset ServerVariables Bugs ADO AJAX XML Chilkat
O O

Weather Controls

Time Of Day
Rain
Wind Speed
Wind Direction
Clouds

ASP : Cookies

2017-01-01

Cookies

// create/overwrite new cookie
response.cookies("NumVisits").Expires = date+365 

// show cookie data
response.write request.cookies("NumVisits")

// set cookie data
response.cookies("NumVisits")=100

// add 1 to cookie data
response.cookies("NumVisits")=request.cookies("NumVisits")+1

// delete cookie
Response.Cookies("NumVisits3").Expires = DateAdd("d",-1,Now())

// logic check if cookie exists
if request.cookies("NumVisits")="" then
   response.cookies("NumVisits")=1
   response.write("Welcome First Timer!")
else
    response.cookies("NumVisits")=request.cookies("NumVisits")+1
    response.write("You have visited this Web page " & request.cookies("NumVisits") & " times before!")
end if