[login.asp]
<html>
<body>
<%
username = Request.Cookies("Sec")("username") ' Veriyi alalım
userpass = Request.Cookies("Sec")("userpass")
%>
<FORM method="" action="security.asp" >
<table>
<tr>td>
kullanıcıadı:<input type="text" name="username" >
</td></tr>
<tr><td>
Şifre:<input type="password" name="userpass">
</td></tr>
<tr><td><input type="submit" value="Enter"></td></tr>
</table>
</form></body></html>
[security.asp]
<%
username = Request.QueryString("username")
userpass = Request.QueryString("userpass")
if username = "deneme" And userpass = "deneme" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
elseif username = "deneme" And userpass = "123456" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
elseif username = "deneme" And userpass = "456" Then
Response.Cookies("Sec")("username") = username
Response.Cookies("Sec")("userpass") = userpass
Response.Redirect ("main.asp")
else
Response.Redirect ("login.asp")
end if
%>
[main.asp]
<html><body>
<%
username = Request.Cookies("Sec")("username") ' Veriyi alalım
userpass = Request.Cookies("Sec")("userpass")
if username <> "" then ' Eğer daha önce veri girilmişse....
%>
Merhaba:<%=username%>
<%
else ' Eğer daha önce çerez kaydedilmedi ise
Response.Redirect ("login.asp")
%>
<% end if %>
</body></html>