Welcome Guest, Not a member yet? Register   Sign In
AJAX keeps killin my session
#1

[eluser]jhyland[/eluser]
So im using CI to manage my sessions, they are kept in the database, and it seems to work just fine, except when I have an AJAX page that
repeatedly pulls from another page within the site (which requires a session), then it will kill the session rather quickly.

EG:
Code:
[removed]
$(document).ready(function() {
    $('#avatars').dataTable( {
"aoColumnDefs": [
     { "bSortable": false, "aTargets": [ 0,1,2,3,4,5 ] }
],
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": 'http://localhost/admin/recache_avatars_feed'
    } );
} );
[removed]

<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="avatars">
<thead>
  <tr>
   <th width="60px">Avatar</th>
   <th width="150px">Username</th>
   <th width="150px">Filetype</th>
   <th width="150px">Source</th>
   <th width="150px">Type</th>
   <th>Result</th>
  </tr>
</thead>
<tbody>
  
</tbody>
<tfoot>
  <tr>
   <th width="60px">Avatar</th>
   <th width="150px">Username</th>
   <th width="150px">Filetype</th>
   <th width="150px">Source</th>
   <th width="150px">Type</th>
   <th>Result</th>
  </tr>
</tfoot>
</table>

That will query the json from that ajax feed as its updated, live, but it will kill the session rather quickly.

Ive tried to expand the timeouts in both PHP settings and CI settings, no luck.

Anyone else had this issue?
#2

[eluser]b0ris55[/eluser]
Yup, something to do with CI updating session on a timed basis to prevent hijacking. I implemented a fix found here and it works, http://ellislab.com/forums/viewthread/138823/




Theme © iAndrew 2016 - Forum software by © MyBB