Last night I ran across a bug I had not seen before. I was hitting a dev site using sessions and I got a "Session is Invalid" error. A quick google search found this post over at bpurcell.org. This led to a Tech Note that describes how to fix the issue.
Archived Comments
maybe you should tell Mr Forta - I hit this bug when using FeedDemon to view his blog
:)
Cheers
Bert
I am getting this error on a installation of CF7. Anyone know if it survived to CF7?
Sami
I'm getting this error in CF7. Does anyone know if the fix is still applicable to ie7? Or is it something different.
I still get this error on CF 8.01.
Try:
http://tech.groups.yahoo.co...
@Dan -- what does that post say -- Id rather not join yet another group to see the post.
Saw this error for the first time today (version 7 service). I was able to get past the error by temporarily changing my sessiontimeout to 0. After the next request I then switched back to the default timeout setting with no problems (yet).
Scott, you can simply clear your cookies and that will have the same effect as you'll be given a new CFID etc.
Just added this to the OnError section of my application.cfc and it will clear cookies automatically.
<cfif isDefined("except.message")>
<cfif except.message is "Session is invalid">
<cfcontent reset="yes">
<cfset tx = structclear(cookie)>
<h3>Your session has timed out <cfoutput>#now()#</cfoutput>. <a href="/">Click here or wait 1 second</a></h3>
<script type="text/javascript">
window.setTimeout(redir, 2000);
function redir()
{
window.location = '/?cb=<cfoutput>#getTickCount()#</cfoutput>';
}
</script>
<cfabort>
</cfif>
</cfif>
I have an error "session is invalid "while running the website ,
i haven't use any application.cfc file in my application ,but i using application.cfm file many places in my application.can u suggest me,where i can place the following code to avoid
session error in application,
<cfif isDefined("except.message")>
<cfif except.message is "Session is invalid">
<cfcontent reset="yes">
<cfset tx = structclear(cookie)>
<h3>Your session has timed out <cfoutput>#now()#</cfoutput>. <a href="/">Click here or wait 1 second</a></h3>
<script type="text/javascript">
window.setTimeout(redir, 2000);
function redir()
{
window.location = '/?cb=<cfoutput>#getTickCount()#</cfoutput>';
}
</script>
<cfabort>
</cfif>
</cfif>
I have an error "session is invalid "while running the website ,
i haven't use any application.cfc file in my application ,but i using application.cfm file many places in my application.can u suggest me,where i can place the following code to avoid
session error in application,
<cfif isDefined("except.message")>
<cfif except.message is "Session is invalid">
<cfcontent reset="yes">
<cfset tx = structclear(cookie)>
<h3>Your session has timed out <cfoutput>#now()#</cfoutput>. <a href="/">Click here or wait 1 second</a></h3>
<script type="text/javascript">
window.setTimeout(redir, 2000);
function redir()
{
window.location = '/?cb=<cfoutput>#getTickCount()#</cfoutput>';
}
</script>
<cfabort>
</cfif>
</cfif>
Hi,
Nice one on for your suggestion; the following worked for me:
<cfif isDefined("exception.message")>
<cfif exception.message is "Session is invalid">
<cfcontent reset="yes">
<cfset tx = structclear(cookie)>
<script type="text/javascript">
window.setTimeout(redir, 100);
function redir()
{
window.location = '/app_root_folder?reset=<cfoutput>#getTickCount()#</cfoutput>';
}
</script>
<cfabort>
</cfif>
</cfif>
Also, note the use of "exception" as against the "except" in the earlier post.
Thanks everyone.