Cookie Test - Check Login v2

<% @ Language="JavaScript" %>

<%

var ExpireDate = new Date();
ExpireDate.
setMonth(ExpireDate.getMonth() + 3);

var strEmail;

if (Request("cookie") == 1) strEMail = Request.Cookies("SavedLogin")("EMail");
else strEMail =
Request("email");

var bLoginSaved;

if (Request("SaveLogin") == "ON") {
     Response.Cookies("SavedLogin")("EMail") = Request("email");
     Response.Cookies("SavedLogin").expires = ExpireDate.getVarDate();
     Response.Cookies("SavedLogin")("pw") = Request("password");

     bLoginSaved = true; // save the login info
}
else bLoginSaved = false;
// do not save the login info

%>

<HTML>

<HEAD><TITLE>Cookie Test - Check Login</TITLE></HEAD>

<BODY>

<% if (bLoginSaved)  { %>

Saving Login information to a cookie

<HR>

<%  } %>

Thank you for logging into the system.

<P>

<% if (Request("cookie") == 1) { %>

Login submitted via cookie

<P>

<%  } %>

E-Mail address confirmation: <% = strEMail %>

</BODY>
</HTML>