[eluser]InsiteFX[/eluser]
This is how I do it, change to what you need.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ------------------------------------------------------------------------
* CI Session Class Extension.
* ------------------------------------------------------------------------
*
* Add the following define to the bottom of application/config/constants.php
* // Define Ajax Request
* define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
*
*/
class MY_Session extends CI_Session {
/*
* Do not update an existing session on ajax calls
*
* @access public
* @return void
*/
public function sess_update()
{
if ( ! IS_AJAX)
{
$this->sess_time_to_update = 300;
parent::sess_update();
}
else
{
$this->sess_time_to_update = 1200;
parenet::sess_update();
}
}
function sess_destroy()
{
parent::sess_destroy();
$this->userdata = array();
}
}
// ------------------------------------------------------------------------
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */
InsiteFX