Welcome Guest, Not a member yet? Register   Sign In
Session not working because of sess_time_to_update mechanism
#3

[eluser]InsiteFX[/eluser]
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ------------------------------------------------------------------------
* CI Session Class Extension for AJAX calls.
* ------------------------------------------------------------------------
*
* ====- Save as application/libraries/MY_Session.php -====
*/

class MY_Session extends CI_Session {

    // --------------------------------------------------------------------

    /**
     * sess_update()
     *
     * Do not update an existing session on ajax or xajax calls
     *
     * @access    public
     * @return    void
     */
    public function sess_update()
    {
        $_ci = get_instance();

        if ($_ci->input->is_ajax_request() === FALSE)
        {
            parent::sess_update();
        }
    }

} // End of class MY_Session.

/* ------------------------------------------------------------------------
* Filename: MY_Session.php
* Location: ./application/libraries/MY_Session.php
* ------------------------------------------------------------------------
*/


Messages In This Thread
Session not working because of sess_time_to_update mechanism - by El Forum - 10-17-2014, 06:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB