title: CakePHP - database sessions, ajax not saving
body: <p>I am using sessions saved in the database. Works well. Lot of data relating to pagination, browsing history etc is stored perfectly within the database.</p>
  
  <p>However, I notice that data sent to a controller using Ajax is not being stored successfully. </p>
  
  <p>If I debug the session within the controller called by ajax, right after I have set the session vars, I see the values appear to be stored correctly in the session, but on subsequent requests, it transpires that the session vars have NOT been saved.</p>
  
  <p>I have done some testing and have found that the problem disappears if I change back to using "php" for the session instead of "database".</p>
  
  <p>I have eliminated pretty much everything from the mix - and it boils down to Cake not saving session data that is sent by ajax. Again, simply switching back to using "php" for sessions, and everything works perfectly.</p>
  
  <p>I wonder if anyone has experienced anything similar?</p>
  
  <p>CakePHP 2.4</p>
  
  <p>Many thanks.</p>