TestCookies. asp
'Check whether the browser accepts Cookies.
<%
StrTest = Request. QueryString ("CookieTest ")
If UCase (strTest) <> Ucase ("true") Then
Session ("_ FlashCookieTest") = True
'The first call. Set the session variable.
'Use QueryString to redirect.
StrURL = Request. ServerVariables ("script_NAME ")
StrQueryString = "? CookieTest = true"
Response. Redirect (strURL & strQueryString)
Response. End
Else
If Session ("_ FlashCookieTest") = True Then
'Redirection completed. Check whether the session variable contains a value.
StrOut = "Cookies = true"
'Session variable contains value, so the browser accepts Cookies.
Else
StrOut = "Cookies = false"
'The Session variable is empty, and the browser never rejects Cookies.
End If
End If
Response. Write (strOut)
'Output to Flash.
%>
SetCookies. asp
<%
For each item in Request. QueryString
Response. Cookies (item) = Request. Querystring (item)
Next
%>
GetCookies. asp
'Read Cookies
<%
For each Cookie in Request. Cookies
StrOut = strOut & Server. URLEncode (Cookie) & "="
StrOut = strOut & Server. URLEncode (Request. Cookies (Cookies ))
StrOut = strOut &"&"
Next
Response. Write strOut
%>