% @language="vbscript" %>
<%
' Was this page posted to?
If UCase(Request.ServerVariables("HTTP_METHOD")) = "POST" Then
' If so, check the username/password that was entered.
If ComparePassword(Request("uid"),Request("pwd")) Then
' If comparison was good, store the user name...
Session("uid") = Request("uid")
if Request.Form("cbrem")="on" then 'Remember me flag is ON: storing UID and PWD in cookies
Response.Cookies("jsfpl")("1") = Request("uid")
Response.Cookies("jsfpl")("2") = Request("pwd")
Response.Cookies("jsfpl").Expires = Now+30 ' Cookie keep time in days: here is 30 days from present
else 'Erase Cookie if flag is not set
Response.Cookies("jsfpl")("1") = ""
Response.Cookies("jsfpl")("2") = ""
Response.Cookies("jsfpl").Expires = Now-1
end if
on error resume next
' ...and redirect back to the original page.
Response.Redirect Session("REFERRER")
if err then
response.write "
Error is: " & Err.Description
response.write "
Uid is: " & Session("UID")
response.write "
Ref is: " & Session("REFERRER")
End if
End If
End If
'If this page is not posted then run code below:
Dim User,Pass,chb
User="" & Request.Cookies("jsfpl")("1")
Pass="" & Request.Cookies("jsfpl")("2")
if Not( User="" and Pass="") then
chb="checked"
end if
%>

a