Welcome Guest, Not a member yet? Register   Sign In
UNRESOLVED - The only REAL problem with CI Sessions: Please confirm this Bug
#8

[eluser]InsiteFX[/eluser]
This works!

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 not an AJAX call update the session
        if ( ! IS_AJAX)
        {
            parent::sess_update();
        }
    }

    function sess_destroy()
    {
        parent::sess_destroy();

        $this->userdata = array();
    }
}

// ------------------------------------------------------------------------
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */

InsiteFX


Messages In This Thread
UNRESOLVED - The only REAL problem with CI Sessions: Please confirm this Bug - by El Forum - 11-08-2010, 05:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB