No problem.

On Sat, 12 Mar 2005 23:18:09 +0100, Nando <[EMAIL PROTECTED]> wrote:
> <!o^o!>
> 
> Oh! Thanks Paul - i didn't see that as a re-assignment.
> 
> Thanks for the example. I'm going to give it a whirl.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Paul Kenney
> Sent: Saturday, March 12, 2005 9:42 PM
> To: [email protected]
> Subject: SPAM-LOW: Re: SPAM-LOW: Re: [CFCDev] Session is Invalid
> workaround / application.cfc
> 
> Looks like a typo...
> 
> Anyhow, how's this?
> 
> <!--- <cfset expirationDateTime = DateAdd("d", -1, Now())> --->
> <cfset expirationDateTime = GetHttpTimeString(DateAdd("d", -1, Now())>
> 
> On Sat, 12 Mar 2005 11:32:06 +0100, Nando <[EMAIL PROTECTED]> wrote:
> > Hmmm .... looks like the right direction - but this line doesn't seem to
> be
> > correct:
> >
> > <cfset expirationDateTime = GetHttpTimeStringexpirationDateTime)>
> >
> > especially following after this line:
> >
> > <cfset expirationDateTime = DateAdd("d", -1, Now())>
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Behalf Of Paul Kenney
> > Sent: Saturday, March 12, 2005 9:53 AM
> > To: [email protected]
> > Subject: SPAM-LOW: Re: [CFCDev] Session is Invalid workaround /
> > application.cfc
> >
> > Here is the code I got that will fix this in Application.cfc:
> >
> > <cffunction name="onError" returntype="void" access="public" hint="">
> >         <cfargument name="exception" type="any" required="true" hint=""/>
> >         <cfargument name="eventName" type="string" required="true"
> hint=""/>
> >         <!--- --->
> >         <cfset var expirationDateTime = NULL>
> >         <cfset var redirectUrl= "/tartan/index.cfm">
> >
> >         <cfif arguments.exception.message IS "Session is invalid" AND
> > IsDefined("cookie.jsessionid")>
> >                 <cfset expirationDateTime = DateAdd("d", -1, Now())>
> >                 <cfset expirationDateTime =
> GetHttpTimeStringexpirationDateTime)>
> >
> >                 <cfheader statuscode="302" statustext="Moved
> Temporarily"/>
> >                 <cfheader name="location" value="#redirectUrl#"/>
> >                 <cfheader name="Set-Cookie"
> > value="JSESSIONID=;expires=#expirationDateTime#;path=/"/>
> >         </cfif>
> > </cffuntion>
> >
> > What it does is delete the session cookie and redirect the browser to
> > a certain page (perhaps the current one)
> >
> > On Fri, 11 Mar 2005 20:09:36 -0800, Paul Kenney <[EMAIL PROTECTED]> wrote:
> > > I have found that if I clear the jsession cookie from my browser, the
> > > session works again.  What if when the exception is caught, a
> > > "cookie-expiration" and "redirect" header is sent to the client?
> > >
> > > <cfcatch type="any">
> > >    <cfheader ... (remove jsession cookie)/>
> > >    <cfheader... (client redirect to current page)/>
> > > </cfcatch>
> > >
> > >
> > > On Sat, 12 Mar 2005 01:31:39 +0100, Nando <[EMAIL PROTECTED]> wrote:
> > > > I've been experimenting with application.cfc
> > > >
> > > > One of the things that i've seen on occasion in 6.1 is a "Session is
> > > > Invalid" error that users can get stuck in. I just saw a post over on
> > > > CF-Talk where someone recommended the following. The error seems to be
> > > > caused, at least according to the poster, by a discrepency or conflict
> > > > between J2EE sessions and CF sessions. It seems that if the CF session
> > > > expires and the underlying J2EE session still exists, CF throws a
> > Session is
> > > > Invalid error at the cfapplication tag, which stops a new CF session
> > from
> > > > being created. The net result is that the user is locked out of the
> > > > application (unless they move to another browser.)
> > > >
> > > > <cftry>
> > > >         <cfapplication
> > > >                 name="myApp"
> > > >                 sessionmanagement="Yes"
> > > >                 sessiontimeout="#CreateTimeSpan(0,0,20,0)#" />
> > > >         <cfcatch type="Any">
> > > >                 <cfapplication
> > > >                         name="myApp"
> > > >                         sessionmanagement="Yes"
> > > >                         sessiontimeout="#CreateTimeSpan(0,0,0,0)#" />
> > > >         </cfcatch>
> > > > </cftry>
> > > >
> > > > I'm experimenting with translating the above to application.cfc like
> so:
> > > >
> > > > <cfcomponent>
> > > >
> > > > <cftry>
> > > >         <cfset this.name = "myApp" />
> > > >         <cfset this.sessionManagement = true />
> > > >         <cfset this.sessionTimeout="#createtimespan(0,0,20,0)#" />
> > > >         <cfcatch type="Any">
> > > >                 <cfset this.name = "myApp" />
> > > >                 <cfset this.sessionManagement = true />
> > > >                 <cfset this.sessionTimeout="#createtimespan(0,0,0,0)#"
> > />
> > > >         </cfcatch>
> > > > </cftry>
> > > >
> > > > Comments? Opinions? Some workaround seems to be necessary, because my
> > first
> > > > CFMX 7 client (human) has run into this error numerous times in the
> last
> > 3
> > > > days as we get this app ready for launch, and he's understandably
> > nervous.
> > > >
> > > > ----------------------------------------------------------
> > > > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the
> > email.
> > > >
> > > > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> > (www.cfxhosting.com).
> > > >
> > > > An archive of the CFCDev list is available at
> > > > www.mail-archive.com/[email protected]
> > > >
> > > >
> > >
> > > --
> > > Paul Kenney
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> > > http://www.pjk.us
> > >
> >
> > --
> > Paul Kenney
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > http://www.pjk.us
> >
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the
> > email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> > (www.cfxhosting.com).
> >
> > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> >
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the
> email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
> >
> > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> >
> >
> 
> --
> Paul Kenney
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> http://www.pjk.us
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the
> email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the 
> email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
> (www.cfxhosting.com).
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
> 
> 


-- 
Paul Kenney
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.pjk.us

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to