Welcome Guest, Not a member yet? Register   Sign In
AJAX calls kill sesion
#8

well making this file seems to work on CI3, but not fix logout on tabs change (firefox BTW), and this file don't need to be autoloaded, placing this on correct directory, autoload the file.

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once 
SYSDIR '/libraries/Driver.php';
require_once 
SYSDIR '/libraries/Session/Session.php';
require_once 
SYSDIR '/libraries/Session/drivers/Session_cookie.php';

class 
MY_Session_cookie extends CI_Session_cookie
{

    public function 
__construct()
    {
        
parent::__construct();
        
log_message('info''MY_Session_cookie loaded');
    }

    protected function 
_sess_update($force false)
    {

        
// Do NOT update an existing session on AJAX calls.
        
if ($force || !$this->CI->input->is_ajax_request())
            return 
parent::_sess_update($force);
    }
    
    
// --------------------------------------------------------------------

        /**
        * sess_destroy()
        *
            * Clear's out the user_data array on sess::destroy.
            *
            * @access    public
            * @return    void
            */
        
public function sess_destroy()
        {
        
$this->userdata = array();

        
parent::sess_destroy();
        }

}

/* End of file MY_Session_cookie.php */
/* Location: ./system/libraries/Session/drivers/MY_Session_cookie.php */ 
Reply


Messages In This Thread
AJAX calls kill sesion - by dansanti - 12-15-2014, 12:44 PM
RE: AJAX calls kill sesion - by albertleao - 12-15-2014, 01:58 PM
RE: AJAX calls kill sesion - by dansanti - 12-15-2014, 02:15 PM
RE: AJAX calls kill sesion - by InsiteFX - 12-15-2014, 02:47 PM
RE: AJAX calls kill sesion - by dansanti - 12-15-2014, 02:55 PM
RE: AJAX calls kill sesion - by InsiteFX - 12-16-2014, 05:15 AM
RE: AJAX calls kill sesion - by drhouse7x - 12-16-2014, 05:19 AM
RE: AJAX calls kill sesion - by dansanti - 12-16-2014, 01:28 PM
RE: AJAX calls kill sesion - by Narf - 12-16-2014, 01:44 PM
RE: AJAX calls kill sesion - by rexcheung727 - 11-08-2020, 07:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB