title: Lucee randomly generates new sessions when using JQuery’s load() method
body: <p>I have a web page that you log into which then creates a session variable that’s checked on all subsequent page accesses and if it doesn’t exist or doesn’t match whats recorded against the session ID you get kicked out of the page.</p>
  
  <hr>
  
  <p>Code Here:
  <code>Application.cfm</code> session setup:</p>
  
  <pre><code>&lt;CFAPPLICATION NAME="myAPP" APPLICATIONTIMEOUT="#CREATETIMESPAN(0,0,60,0)#"  sessionTimeout=#CreateTimeSpan(0, 0, 20, 0)# sessionManagement="Yes"&gt; 
  </code></pre>
  
  <p>Checked session variable set:</p>
  
  <pre><code>&lt;CFLOCK TIMEOUT="30" THROWONTIMEOUT="no" TYPE="Exclusive" Scope="session"&gt;
    &lt;CFSET session.started = #ucase(dbGUID)#&gt;
  &lt;/CFLOCK&gt;
  </code></pre>
  
  <hr>
  
  <p>Now the page also loads data into different DIV’s every few seconds via JQuery’s load() method, from different backend pages. This all works fine for some people who have no issues at all, however some people it will work fine for anything from a few mins to a few hours and then suddenly Lucee will generate a new session causing the data loaded back in the main page to force the main page to refresh so you can log back in again. However what happens is that the page refreshes and the original session still actually exists so is then used again and the person in then able to see the page data again. This could happen loads of times for some people and never for others.</p>
  
  <p>I’m sure it’s not personal as trying it on different PC’s for the same person it’s ok on some and not on others. Trying it directly on the web server (with a hosts file for the domain pointing locally) its fine and no issues. It doesn’t appear to be the load balancer as it happens both on and off the load balancer.
  Just to be clear as well, it’s not 1 specific page causing the new session, it could be any of the ones in use, it’s also not caused by the first attempt to get to the page as it could be accessed dozens of times prior to the new session being generated. It’s also not timeouts as the session timeout is set to 20 mins but it could happen within a minute of the original session being set.</p>
  
  <p>Question is why does Lucee suddenly decide to create a new session (the old one still exists), and how could I stop it and/or get it to go back using the original session again.</p>