0

I have an application that keeps giving me Variable undefined in session. This happens randomly. I can click on a page and get the error, log out and then back in and click on the same page and don't get the error, click three more pages fine, then click another page and get the error again. I have not found any rhyme or reason to it. In my application.cfm I have:

<cfset SessionTimeout = CreateTimeSpan(0, 2, 0, 0)>
<cfset LoginTimeout = 7200>
<cfapplication name="redbook"
           clientmanagement="Yes"
           sessionmanagement="Yes"
           setclientcookies="Yes"
           clientstorage="cookie"
           sessionTimeout = #SessionTimeout#>

In looking at a proxy debugger, I can see all my session variables declared on the page before it errors. On the next page (when it errors) the only session variables I see are:

cfid, cftoken, sessionid, urltoken

Has anyone else experienced this? I am running Coldfusion Version 9.0.2.282541 on Windows Server 2008 R2. Please let me know if you need any more details.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Lauren Robinson
  • 443
  • 2
  • 9
  • 26
  • 1
    And are the `cfid` and `cftoken` values the same or different? Is there a change in domain name or http/https amongst these requests? Is there anything in the CF or JRun logs around when this happens? – Adam Cameron Oct 22 '13 at 16:24
  • The cfid and cftoken do change between the good page and the page that errors. I didn't notice this. What could cause that? There is no domain change or http/https between the pages. I don't have access to the jrun logs. The cflogs just state the "variable undefined in session" message. – Lauren Robinson Oct 22 '13 at 16:49
  • Sounds like a new session is being created. Is there maybe a process that clears out session vars that is being called/included inadvertently? Does this happen in all browsers or only a certain one? – Scott Stroz Oct 22 '13 at 16:59
  • The only file that has anything with session clearing is the logout file, and it's not called between any of these pages. I verified that with the proxy debugger. I've tried it in both Chrome and Firefox. – Lauren Robinson Oct 22 '13 at 17:23
  • 2
    What do you mean by 'proxy debugger'? Also, is there any hardware, like a load balance between client and server that might be dropping the session? – Scott Stroz Oct 22 '13 at 17:38
  • I was using Charles. It shows every page that you go to, including the ones you don't actually see load on the screen. We actually do have a load balance because we have 2 servers. That possibly could be the issue. I'll explore that further. Thanks!! – Lauren Robinson Oct 22 '13 at 17:46
  • 1
    I got the load balancing turned off, and no more session error. Thanks a bunch!! – Lauren Robinson Oct 22 '13 at 19:53
  • Since you found the solution, you should put it in as an answer so that others can know how to solve this – James A Mohler Dec 10 '13 at 16:01

1 Answers1

0

The issue was the load balancing. As it went from page to page, it sometimes switched servers, clearing out the session variables.

Lauren Robinson
  • 443
  • 2
  • 9
  • 26