[eluser]Codepeak[/eluser]
Good idea! I'll check the cookie being sent by the AJAX request.
Here's a modification to the Session library to not to do any write or update actions if the controller is ajax. Not fully optimized or nicely done, but does what it should during my debugging. I've also added log_message to almost every line of the session library so I can see what and where it goes wrong
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class My_Session extends CI_Session {
/**
* Check if it's a ajax request
*
* If the current call is a ajax request, determinated
* by POST-variable is_ajax, then the session should
* not be updated.
*
* Every AJAX request should POST the variable is_ajax
* to the controller to have this work.
*
*/
var $myCI = FALSE;
function load_my_CI()
{
if ( $this->myCI === FALSE )
{
$this->myCI =& get_instance();
}
return;
}
function sess_update()
{
$this->load_my_CI();
if ( $this->myCI->uri->segment(1) !== 'ajax' )
{
parent::sess_update();
}
}
function sess_write()
{
$this->load_my_CI();
if ( $this->myCI->uri->segment(1) !== 'ajax' )
{
parent::sess_write();
}
}
}