----- Original Message -----
From: "Cameron Childress" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, February 10, 2004 3:15 PM
Subject: RE: How to tell if a session has expired?

> As far as a CF solution, I suppose you could set a cookie timestamp with
> each pageview and compare times to see if it's beyond the session timeout
on
> each request.  Though that solution might be tricky and seems like it would
> be prone to error.

That might work fine.  Either a cookie or a CF client variable with a
timestamp or flag stating whether or not a session had been established.

<cfif not IsDefined("session.basketnumber")>
  <cfif IsDefined("client.sessionflag")>
    Your session has expired.
  <cfelse>
    Your shopping cart is empty.
  </cfif>
</cfif>

Or something a little bit more complex if you want to utilize a timestamp and
only give the "session has expired" message if the session expired
"recently".  You probably wouldn't want to display this message, for
instance, if the session expired three days ago.

Using a cookie I could probably just set an expiration on the cookie itself.
If the cookie exists, but the session variable doesn't then I'd know a
session had expired.

Thanks.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to