Avatar of SimplyGeeky
SimplyGeekyFlag for United States of America asked on

Aborting ColdFusion execution if session expired

I'm really new to CF (see my other questions) and have some terrible code to work with. We're trying to gracefully fail if the session has expired (the user is proceeding through a series of choices, and when they've reviewed everything, it will be written to the database; until then it's all tracked in session vars). Right now if the session expires before they submit the final time, the app bombs with a CF error "Session.foobar" is not defined...

In my Application.cfm I have (3 minutes is for testing purposes)
<CFAPPLICATION NAME="crhopPublic.1" CLIENTMANAGEMENT="NO" SESSIONMANAGEMENT="YES" SESSIONTIMEOUT="#createTimeSpan(0, 0, 3, 0)#">

<CFPARAM name="session.IsLoggedIn" default="false">

<CFIF "session.IsLoggedIn" EQUAL "false">
  <CFLOCATION URL="session_timeout.cfm">
</CFIF>

And when the user first logs in I have

<cfset "session.IsLoggedIn" = "true">

What's wrong with this picture? (Even if "true" and "false" are literal strings instead of booleans, this logic should work, at least to my mind.)
ColdFusion Language

Avatar of undefined
Last Comment
SimplyGeeky

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
SidFishes

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
SimplyGeeky

Man this language is rough. Half the things need quotes, half don't. Oh well, works at any rate.
Your help has saved me hundreds of hours of internet surfing.
fblack61