I am looking at cookies for the first time
My code is below
When I run the scipt the cookie is set and as I run it again using a FORM to reschedule and again my counter increments, then I close the browser, and restart and I am expecting the cookie to be found now and continue counting where I left off before. What I get is no cookie found so the count starts at 1 again
This is not what I was expecting
I have internet options->privacy set to "accept all cookies"
Running Win2k Pro
Any ideas, where is my code or thinking astray?
<% @language=vbscript %>
<% Option Explicit %>
<%
Dim k, item, strX, key
Response.write("<HTML><HEAD><TITLE>Cookie testing</TITLE></HEAD><BODY>")
Response.write("<h2>Processing Cookies</h2>")
response.write("<FORM name=fm1 ACTION=cookies2.asp method=GET>")
response.write("<INPUT name=pass type=submit value='GO'>")
response.write("</FORM>")
response.write("<p>Before<br>JWtest(" & request.cookies("JWtest") & ")JWtest1(" & request.cookies("JWtest1") & ")")
k = request.cookies("JWtest")
if k="" then
response.Cookies("JWtest")=1
response.Cookies("JWtest").expires = date + 365
response.Cookies("JWtest1")="john@lortim.demon.co.uk"
else
response.Cookies("JWtest")= k + 1
end if
response.write("<br>After<br>JWtest(" & request.cookies("JWtest") & ") JWtest1(" & request.cookies("JWtest1") & ")")
Response.write("</BODY></HTML>")
%>
My code is below
When I run the scipt the cookie is set and as I run it again using a FORM to reschedule and again my counter increments, then I close the browser, and restart and I am expecting the cookie to be found now and continue counting where I left off before. What I get is no cookie found so the count starts at 1 again
This is not what I was expecting
I have internet options->privacy set to "accept all cookies"
Running Win2k Pro
Any ideas, where is my code or thinking astray?
<% @language=vbscript %>
<% Option Explicit %>
<%
Dim k, item, strX, key
Response.write("<HTML><HEAD><TITLE>Cookie testing</TITLE></HEAD><BODY>")
Response.write("<h2>Processing Cookies</h2>")
response.write("<FORM name=fm1 ACTION=cookies2.asp method=GET>")
response.write("<INPUT name=pass type=submit value='GO'>")
response.write("</FORM>")
response.write("<p>Before<br>JWtest(" & request.cookies("JWtest") & ")JWtest1(" & request.cookies("JWtest1") & ")")
k = request.cookies("JWtest")
if k="" then
response.Cookies("JWtest")=1
response.Cookies("JWtest").expires = date + 365
response.Cookies("JWtest1")="john@lortim.demon.co.uk"
else
response.Cookies("JWtest")= k + 1
end if
response.write("<br>After<br>JWtest(" & request.cookies("JWtest") & ") JWtest1(" & request.cookies("JWtest1") & ")")
Response.write("</BODY></HTML>")
%>