Welcome Guest, Not a member yet? Register   Sign In
Keeping CI Session Alive
#6

[eluser]InsiteFX[/eluser]
./application/libraries/MY_Session.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ------------------------------------------------------------------------
* Created by phpDesigner 8.
* Date : 5/6/2012
* Time : 11:19:06 PM
* The Learn CodeIgniter Development Team.
* ------------------------------------------------------------------------
*
* Class MY_Session
*
* @package  Package  CodeIgniter
* @subpackage Subpackage session
* @category category session
* @author  Raymond L King Sr.
* @link  http://example.com
* ------------------------------------------------------------------------
* To change this template use File | Settings | File Templates.
* ------------------------------------------------------------------------
*/

/**
* ------------------------------------------------------------------------
* CI Session Class Extension for AJAX and Xajax method 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())
  {
   parent::sess_update();
  }
    }

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

/**
  * 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 Class.

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


Messages In This Thread
Keeping CI Session Alive - by El Forum - 06-14-2012, 01:24 AM
Keeping CI Session Alive - by El Forum - 06-14-2012, 03:28 AM
Keeping CI Session Alive - by El Forum - 06-14-2012, 10:31 AM
Keeping CI Session Alive - by El Forum - 06-14-2012, 10:35 AM
Keeping CI Session Alive - by El Forum - 06-14-2012, 10:44 AM
Keeping CI Session Alive - by El Forum - 06-14-2012, 12:19 PM
Keeping CI Session Alive - by El Forum - 06-14-2012, 12:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB