<%
'----------------------------------------------------------------------------------------
'-  ASP Security Login - Version 2.0 - 01 June 2005 
'-  Copyright © 2005 - Livio Siri (http://www.livio.net) - All Rights Reserved.     
'----------------------------------------------------------------------------------------
'--- If not already logged in, record the referer page and redirect to login page
if Not Session("bLoginSuccessful") then
	response.redirect "users/login.asp?comebackto=" &_
	request.servervariables("script_name") &_
	"?" & server.urlencode(request.querystring)
else
	'--- If logout required close sessions and window
	If Request.Querystring("logout") <> "" then
		Session("bLoginSuccessful") = False
		Session.Abandon
	response.redirect request.servervariables("script_name")
	End if
end if
%> 
