View Single Post
Old 04-08-2010, 09:05 PM   PM User | #9
suzierthanyou
New Coder

 
Join Date: Jul 2008
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
suzierthanyou is an unknown quantity at this point
This is so useful, whoever has written this is amazing and I would be SO happy if you could help me understand why it just won't work for me!

I'm totally stuck. You can access memberwelcome.cfm even if you're not logged in and logging in doesn't even seem to do anything.

What am I doing wrong?!

application.cfm

Code:
<cfcomponent output="false">

    <cfset this.name = "MyApplication">
    <cfset this.applicationTimeout = createTimeSpan( 2, 0, 0, 0 )>    <!--- 2 Days --->
    <cfset this.sessionManagement = true>
    <cfset this.sessionTimeout = createTimeSpan( 0, 0, 20, 0 )>    <!--- 20 min --->
    <cfset this.setClientCookies = true>

    
    <cffunction name="onSessionStart">
        <cfset session.loggedIn = false>
    </cffunction>
    
    
    <cffunction name="onRequestStart">
        <cfargument name="targetPage" type="string" required="true">
        
        <!--- If the user is not logged in, and they are not on the login or login processing page, 
                    then redirect them back to login.cfm --->
        <cfif NOT session.loggedIn AND targetPage neq "http://newmedia.leeds.ac.uk/ug06/cs06sr/cf/cfhome.cfm" AND targetPage neq "http://newmedia.leeds.ac.uk/ug06/cs06sr/cf/login_process.cfm">
            <cflocation url="http://newmedia.leeds.ac.uk/ug06/cs06sr/cf/cfhome.cfm">
        </cfif>
    </cffunction>
    
</cfcomponent>
suzierthanyou is offline   Reply With Quote