[eluser]Benito[/eluser]
[quote author="InsiteFX" date="1306377211"]The CSRF cookie has an exprie time of 2 hours and is not setable. The session cookie can expire during AJAX updates or when changing pages, this is why you need to use the below.
The old code should be replaced with this for CI 2.0+!
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session {
/**
* Update an existing session
*
* @access public
* @return void
*/
public function sess_update()
{
// skip the session update if this is an AJAX call!
if ( ! is_ajax_request())
{
parent::sess_update();
}
}
}
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */
// the is_ajax_request() is now a method in CI 2.0+ See: system/core/input.php at the bottom.
InsiteFX[/quote]
Do you mean?
Code:
if ( ! $this->CI->input->is_ajax_request())