Welcome Guest, Not a member yet? Register   Sign In
Losing session user_data randomly
#2

[eluser]InsiteFX[/eluser]
application/config/constants.php
Code:
// Define Ajax Request
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');

application/libraries/MY_Session
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
* ------------------------------------------------------------------------
* CI Session Class Extension.
* ------------------------------------------------------------------------
*
*
*/

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)
        {
            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
Losing session user_data randomly - by El Forum - 10-07-2010, 09:43 PM
Losing session user_data randomly - by El Forum - 10-07-2010, 11:30 PM
Losing session user_data randomly - by El Forum - 10-08-2010, 12:12 AM
Losing session user_data randomly - by El Forum - 10-08-2010, 01:34 AM
Losing session user_data randomly - by El Forum - 10-26-2010, 08:34 PM
Losing session user_data randomly - by El Forum - 11-04-2010, 02:49 AM
Losing session user_data randomly - by El Forum - 11-04-2010, 04:50 AM
Losing session user_data randomly - by El Forum - 11-04-2010, 05:33 AM
Losing session user_data randomly - by El Forum - 11-04-2010, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB