One way to have client vars "expire" is to check to run simple check within
the application.cfm file. The following code checks if a user is logged in
(IsLoggedIn <> 0), and if the value of the IsloggedIn client variable is no
older than 20 minutes. If the client.IsLoggedIn variable is older than 20
minutes the user gets booted to the login screen. If the client Var is less
than 20 minutes it gets reset to the current time, essentially giving the
user another 20 minutes on the system. This code needs to run on every
page ie. application.cfm,app_globals.cfm.
<!--- update client.islogged in on each page with the current date and time
if the current value is no older than 20 minutes --->
<cfif client.IsLoggedIn neq 0 and (client.IsLoggedIn +
createtimespan(0,0,20,0)) lte now()>
<cfset client.IsLoggedIn = 0>
<cfset attributes.method="login">
</cfif>
<Cfif Client.IsLoggedIn neq 0>
<cfset client.IsLoggedIn = now()>
</cfif>
Brook Davies
At 11:33 AM 17/05/00 +1200, you wrote:
>Not being an expert or anything.... but I think session variables are
>probably a
>dead cause for clustered systems. At least client variables can be stored in a
>shared database.
>
>BTW, is there an easy way you could make a client variable "expire", and
>use it
>like a session variable?
>
>David
>
>Todd Ashworth wrote:
> >
> > Yup .. that's the way it works .. but what if the person get's
> 'diconnected'
> > .. as in loses ability to get to the site for say .. 5 minutes? Now, I'm
> > not sure *exactly* how this works, so someone feel free to correct me.
> > Using a round-robin DNS setup (a less than optomized setup where, as users
> > come to a site with clustered servers, that site's DNS servers cycle
> through
> > the list of clustered servers and sends each user to the next server in the
> > list, regardless of that server's individual load .. repeat as needed)
> > wouldn't the user get routed to a different server than they were on last
> > time effectively destroying their session, even though it didn't
> > 'legitimately' time out?
> >
> > Now that I think about it, couldn't the same thing happen on a setup where
> > the load balancing employed routing to a particular server that had the
> > least load?
> >
> > That has to work differently than I am thinking .. or at least there has to
> > be a 'more stateful' option available that will handle common internet
> > problems such as that.
> >
> > .Todd
> >
> > ----- Original Message -----
> > From: Scott Weikert <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, May 16, 2000 5:19 PM
> > Subject: RE: Session vars in a clustered environment
> >
> > > Define "disconnected". If the user came back before the session timed
> out,
> > > I'd figure he'd still be golden - single server or
> > > clustered-as-described-below.
> > >
> > > What I was talking about is say, Joe User comes along to your site. You
> > have
> > > Servers A, B, C. Whatever load-balancing situation you have going
> > determines
> > > B is the least utilized now, so sends Joe on to B. Joe stays on B for the
> > > duration. If Joe leaves, his session times out, and he comes back the
> next
> > > day, start over. But if he sticks around and keeps hitting the site (and
> > > refreshing the session timeout), he'd stay on B.
> > >
> > > Mind you, I couldn't get into details on how they do this - I'm just
> > > relaying stuff from the meeting we had with some Allaire guys, and
> this is
> > > what they told us.
> >
> >
> ------------------------------------------------------------------------------
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or send a message to [EMAIL PROTECTED] with 'unsubscribe'
> in the body.
>------------------------------------------------------------------------------
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.