Yes you can delete them. <CFIF IsDefined("Client.CFTOKEN") OR IsDefined("Client.CFID")> <CFSET DeleteClientVariable("CFTOKEN")> <CFSET DeleteClientVariable("CFID")> </CFIF> <CFIF IsDefined("Session.CFTOKEN") OR IsDefined("Session.CFID")> <CFSET StructDelete(Session, "CFTOKEN")> <CFSET StructDelete(Session, "CFID")> </CFIF> <CFIF IsDefined("Cookie.CFTOKEN") OR IsDefined("Cookie.CFID")> <CFCOOKIE NAME="CFTOKEN" EXPIRES="NOW"> <CFCOOKIE NAME="CFID" EXPIRES="NOW"> </CFIF>
There are two major products that come out of Berkeley: LSD and [Unix] BSD. We don't believe this to be a coincidence. Doug Brown ----- Original Message ----- From: "Kay Smoljak" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, January 10, 2002 5:59 PM Subject: Re: Overwriting a session > I'm not actually setting a cookie... I'm referring to the cookies that > CF sets automatically for the cfid and cftoken. That's what I'm > wondering... Can I overwrite or delete these cookies so that CF will > send new ones? > > Thanks, > Kay. > > "Joel Parramore" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > You're using the cfid and cftoken values in the url but set a cookie > > anyw ay as a fallback? If that's the case... you could use an > > IsDefined("session.cfid > > ") > > check instead of the cftry-cfcatch (or in addition to, depending on > > how y ou've laid out error handling. If the session.cfid is defined, > > use it; otherwi se, see > > if the cookie.cftoken and cookie.cfid variables exist. If they do, > eithe > > r use > > them to reset the session variables or discard them --- you usually > delet > > e > > cookies by resetting the expires value either to now or a date before > now > > and > > sending a response to the browser. (I haven't tried the last before > for > > cfid/cftoken session/client management cookies, so it's possible > ColdFusi > > on > > won't let you override those settings). > > > > Regards, > > Joel Parramore > > > > > > > > > > > -----Original Message----- > > > From: Kay Smoljak [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, January 10, 2002 8:46 AM > > > To: CF-Talk > > > Subject: Overwriting a session > > > > > > > > > Hi all, > > > > > > Basically, I don't like relying on cookies, so I code my apps > > > appending the cfid and cftoken to each link where session variables > > > are required.> At the beginning of each page request I do <cfset > > > token= "cfid/#session.cfid#/cftoken/#cftoken#/"> (I'm using search > engine safe > > > URLS) and then I append the #token# var to links. > > > > > > Sometimes, however, if a session is destroyed for some reason - I > > > accidently ran a structclear(Session) once, for example - the cfset > > > throws an error that session.cfid can't be found. I can't > > > successfully run the page until I close the browser and delete the > > > cookie, at which time the CFID and CFTOKEN get reset, I'm presuming. > > > > > > In case this happens, I'm thinking I should have a try-catch block > > > around the locked assignment statement. If it fails, I should try to > > > > delete the cookie. OR maybe read the values out of the cookie if > > > they exist, and use these? I don't know if this will work or how to > > > actually do it, however. > > > > > > Any ideas/code snippets? Am I going about this the wrong way? Ta, > > > Kay. > > > > > > > > > ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists