Skip to content

Instantly share code, notes, and snippets.

@sotoz
Created December 14, 2015 12:50
Show Gist options
  • Save sotoz/cf2e3e5c379af745e129 to your computer and use it in GitHub Desktop.
Save sotoz/cf2e3e5c379af745e129 to your computer and use it in GitHub Desktop.
Session fix for codeigniter
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once BASEPATH . '/libraries/Session.php';
class MY_Session extends CI_Session
{
function __construct()
{
parent::__construct();
$this->CI->session = $this;
}
function sess_update()
{
// Do NOT update an existing session on AJAX calls.
if (!$this->CI->input->is_ajax_request())
return parent::sess_update();
}
}
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment