PopcornCoder
2009-03-30 13:09:44 UTC
Why does the attached code not cause people to redirect to the login.cfm page
if there is no accessAllowed session variable? If they log in and are
successfull it sets the variable accessAllowed = true which means the user is
authenticated however it stopped working and the only thing I can see that's
changed is this code.
<cffunction name="onRequestStart">
<!--- check to see if logged in --->
<cfif not structKeyExists(session,'accessAllowed') or session.accessAllowed eq
false>
<!--- if not logged in and not on login page, redirect to login --->
<cfif listLast(cgi.script_name,'/') neq 'login.cfm'>
<cflocation url="login.cfm">
</cfif>
</cfif>
if there is no accessAllowed session variable? If they log in and are
successfull it sets the variable accessAllowed = true which means the user is
authenticated however it stopped working and the only thing I can see that's
changed is this code.
<cffunction name="onRequestStart">
<!--- check to see if logged in --->
<cfif not structKeyExists(session,'accessAllowed') or session.accessAllowed eq
false>
<!--- if not logged in and not on login page, redirect to login --->
<cfif listLast(cgi.script_name,'/') neq 'login.cfm'>
<cflocation url="login.cfm">
</cfif>
</cfif>