<snip>
client vars are the way to go. Just remember that you may now have problems
with people who have disabled cookies on their browsers...

-george
----------------------------------------

Ya know...you gotta go spoil my good morning! <grin>

Yeah, I was afraid some people wouldn't like my cooking and refuse to eat my
Chocolate chip cookies, and, I'm in the process of baking some better ones
so that even if they do refuse again, I can still maintain my sense of good
humor and allow them to eat something else.

<grin>

Actually, in reality,
I found this bit of code from Andy:

What do you think? However, there is an IIF in there, and I know how we all
hate IIF.

<!---Ensure session is maintained regarless of cookies being on or off --->
<cfif NOT ISDEFINED("Client.rollCount")>
        <cfset Client.rollCount = 1>
        <!--- Try to set a cookie for testing later --->
        <cfcookie name="isOn" value="testing">

        <!--- This sets addtoken --->
        <cfset application.addtoken =
"cfid=#client.cfid#&cftoken=#client.cftoken#">
<cfelse>
        <!--- If cookies are not on then make a query string --->
        <cfset application.addtoken = iif(not isdefined("cookie.isOn"),
DE("cfid=#client.cfid#&cftoken=#client.cftoken#"), DE(""))>
</cfif>

<!---If user closes browser end session --->
<cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
        <cfset cfid_local = Cookie.CFID>
        <cfset cftoken_local = Cookie.CFTOKEN>
        <cfcookie name="CFID" value="#cfid_local#">
        <cfcookie name="CFTOKEN" value="#cftoken_local#">
</cfif>

You then need to append "&#application.addtoken#" to the end of every
hyperlink, form posting, and cflocation in your web site.  Also for
cflocation you need to set the attribute "Addtoken = No".

This will then append the CFID and CFTOKEN to the end of the url or an empty
string, depnding on whether the user has cookies turned on or not.

The second bit of code simply ensures that the session is killed when the
user closes the browser so doesn't rely on the session/client timeout
specified in the application.cfm or by the CFServer

------------------------------------------------------------------
Andrew Ewings

Erika

"Blessed are they who can laugh at themselves, for they shall never cease to
be amused."

-----Original Message-----
From: George Kaytor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 9:15 AM
To: CF-Community
Subject: RE: Client versus Session...


In your case, client vars are the way to go. Just remember that you may now
have problems with people who have disabled cookies on their browsers...

-george


>From: "Erika L Walker" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Community <[EMAIL PROTECTED]>
>Subject: RE: Client versus Session...
>Date: Wed, 02 May 2001 08:55:58 -0400
>
>We had session bumped up to infinity! <grin>
>
>No, we went through all the regular channels, checking our Application.cfm,
>making sure everything was just the way it was supposed to be, had the host
>up the timeout in Administrator, the whole nine yards.
>
>What I found out though, was if CF restarted for any reason while a session
>was going, it lost session state. And I think here-in lies our culprit.
>
>We aren't storing anything more complex than a user's name and reference
>number, and in the admin section, a security level. That's it. Nothing
>more.
>
>So, from reading and listening to some advice over on CF-Talk, I've been
>persuaded to try client vars. The deed is done now. All I have to do is sit
>back and wait for any more errors to pour in.
>
>I would really love to pull together a DEFINITIVE, FINAL wording on when to
>use which and exactly how to use which in exactly which situation. Does
>this
>exist anywhere?
>
>Erika
>
>"Blessed are they who can laugh at themselves, for they shall never cease
>to
>be amused."
>
>-----Original Message-----
>From: George Kaytor [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 02, 2001 8:33 AM
>To: CF-Community
>Subject: Re: Client versus Session...
>
>
>Couldn't you just bump up the timeout setting for session vars? What is the
>session vars are holding query sets?
>
>-george
>
>
> >From: "Dain Anderson" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: CF-Community <[EMAIL PROTECTED]>
> >Subject: Re: Client versus Session...
> >Date: Wed, 02 May 2001 01:12:40 -0400
> >
> > > I am about to convert a site that I have been having long-standing
> >issues
> > > with timing out, etc. Is it really as simple as turning all the
> > > session.whatevers into client.whatevers and making sure
>clientmanagement
> >is
> > > turned on?
> >
> >The short answer: yep!
> >
> >I'm sure you'll get several detailed and convoluted responses that may
> >provide added confusion, but essentially the answer is yes.
> >
> >Dain Anderson
> >Caretaker, CF Comet
> >http://www.cfcomet.com/
> >
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to