OK, i havent worked with asp and cookies together before. I have a new page design and an old one. the html is contained in 2 subs, SUB OLDPAGE and SUB NEWPAGE.
This is what Im trying to do
- user goes to
www.mysite.com/ and gets OLDPAGE by default
- user goes to
www.mysite.come/?nsmc=new . I want to then set a cookie for 30 days storing the cookie "nsmc" as equaling "new" , then user gets NEWPAGE
- user goes to
www.mysite.com/ ( nsmc cookie shoudl now equal new) and serves NEWPAGE
- user goes to
www.mysite.com/?nsmc=old - then set cookie nsmc to "old and serve OLDPAGE
on subsequent visits to
www.mysite.com user will again get OLDPAGE
ok, so this is what I have
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
IF Request.Querystring("nsmc") = "new" THEN
Response.Cookies("nsmc")= "new"
ELSEIF Request.Querystring("nsmc") = "old" THEN
Response.Cookies("nsmc")= "old"
END IF
Response.Cookies("nsmc").Expires = Date() + 30
IF Request.Cookies("nsmc") = "new" THEN
NEWPAGE
ELSE
OLDPAGE
END IF
SUB NEWPAGE
%>
<p> this is my new page design</p>
<%
END SUB
SUB OLDPAGE
%>
<p>this is my old page<p>
<% END SUB %>