EllisLab text mark
Advanced Search
     
AJAX keeps killin my session
Posted: 03 November 2012 05:03 PM   [ Ignore ]
Joined: 2012-08-04
16 posts

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:

[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?

 
Posted: 06 November 2012 09:25 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2010-10-01
8 posts

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/