New cfcUnit release coming soon.

After taking a look at the cfcUnit code with CFMX 7, I have discovered some things that have changed from CFMX 6.1 to 7. Basically, you can no longer directly instantiate the class "WEB-INF.cftags.component", and I did this in a number of places in the framework's self tests. There are also some issues with the displayed results, so I am going to revisit the style information.

I suppose this will be a good time to also go ahead and make it offically a 1.0 release (which it really has been for almost a year).

CFFORMs Galore!

Session is invalid...a solution.

There has been much discussion about a very annoying bug and how it has afflicted the customers at CrystalTech that have sites running on ColdFusion 7. For those of you who don't know what I am talking about, those in the loop know this as "Session is invalid". Anyhow, it has something to do with J2EE sessions getting out of synch with the ColdFusion sessions...

Anyhow, there are solutions out there for use in Application.cfm files, but there aren't any for Application.cfc files. Well, I think I have a solution that works using the onError() method in Application.cfc. I'd be curious to see if this works for anyone else. Let me know.

Well here it is:

<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 = "">
<cfset var redirectUrl= "/index.cfm">

<cfif arguments.exception.message IS "Session is invalid" AND
IsDefined("cookie.jsessionid")>

<cfset expirationDateTime = GetHttpTimeString(DateAdd("d", -1, Now()))>

<cfheader statuscode="302" statustext="Moved Temporarily"/>
<cfheader name="location" value="#redirectUrl#"/>
<cfheader name="Set-Cookie"
value="JSESSIONID=;expires=#expirationDateTime#;path=/"/>

</cfif>
</cffuntion>

BlogCFC was created by Raymond Camden. This blog is running version 5.5.003.