Session express when I use ajax imap - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Session express when I use ajax imap (/showthread.php?tid=69604) |
Session express when I use ajax imap - wolfgang1983 - 12-20-2017 Hello, I use ajax to call some imap functions how ever the session tends to expire before the sess_expiration 7200 limit. I am not sure if it is some thing to do with session_time_to_update? Any suggestions what I should change? PHP Code: $config['sess_driver'] = 'files'; RE: Session express when I use ajax imap - InsiteFX - 12-21-2017 The session expiration time. There is also a CodeIgniter method for checking Ajax calls. PHP Code: if (is_ajax_request()) RE: Session express when I use ajax imap - XtreemDeveloper - 12-23-2017 you can basically disable the session updates when AJAX calls are made. This code should go in /application/libraries/MY_Session.php <?php class MY_Session extends CI_Session { /** * Update an existing session * * @access public * @return void */ function sess_update() { // skip the session update if this is an AJAX call! This is a bug in CI; see: // https://github.com/EllisLab/CodeIgniter/issues/154 // http://codeigniter.com/forums/viewthread/102456/P15 if ( !($this->CI->input->is_ajax_request()) ) { parent:ess_update(); } } } |