登陸頁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
%>