登陸頁login.asp:
<%
if request.Form.count>0 then
session("username")=request("username")
application(session("username"))=session.SessionID
response.Redirect("index.asp")
end if
%>
<form method=post action="">
<input type="text" name="username"><input type="submit">
</form>
其他需要認證的頁面index.asp:
<%
if application(session("username"))=session.SessionID then
response.Write("已經登陸")
else
response.Write("沒有登陸")
end if
%>