This content has been marked as final. Show 5 replies
Which version of CF?
could it be picking up session info from a different user? have you looked at the http_user_agent - is it a human user or a crawler? have noticed wierd things with our error emails and crawlers on occasion.
I have - in the past - had problems managing session variables with
constructs like this:
Where the isDefined() expression was true, but the following line errored
with "variable does not exist".
It was only with session variables that this happenend.
We changed to using structKeyExists(), and the problem went away. This was
back in CFMX6x, and have never used isDefined() since, so not sure if the
problem still persists.
This does not help your situation, but is perhaps confirmation that there
is something flaky about the session scope, and how CF determines the
existence of variables in it.
I don't know how the error template stuff works... is it a separate request
(ie: are things like Application.cfm executed again?). Could the variable
somehow be getting set between the time the error is thrown and when the
<cfdump> is emailed to you?
Does the error always crop up at the same piece of code / same variable, or
could it be any session variable, at various different places in your code?
I've noticed the same. Crawler errors I just ignore.
Error occurs at any random point in evaluating session variables. I used to think the sessions were just timing out, but then I set a one-year session timeout and it didn't change anything.
I'll give the StructKeyExists method a try, see if that helps any.
As far as the error template, you can specify a file in CF admin to run whenever an unhandled exception occurs. It essentially runs as an include in the template that threw the error. So we have ours show the user a pretty "we're sorry" screen and send us an email with the error & all the scope dumps in it. It doesn't rerun any new code (like app.cfc), it acts something like a dynamically-included file with an abort at the end of it.