title: What is Eating My Array in Django Session?
body: <p>I want to fetch 10 articles from my <code>Articles</code> model on first load and then another 10 as users scroll towards the bottom via <code>AJAX</code>. I store the ids of the first 10 in an array and then append the subsequent ones to it. This is to enable fetch articles that are not in that list but I get empty array and the first 10 articles are still fetched when I scroll to the bottom again and again.</p>
  
  <p>First load:</p>
  
  <pre><code>import json
  
  my_interest = user_object.interet #this returns [3,4,55,24,57]
  articles = Articles.objects.all()[:10]
  fetched = [x.id for x in articles]
  request.session['fetched'] = json.dumps(fetched)
  </code></pre>
  
  <p>Another 10 via AJAX:</p>
  
  <pre><code>import operator
  
  fetched = json.loads(request.session['fetched'])
  my_interest = user_object.interet #this returns [3,4,55,24,57]
  
  query = reduce(operator.and_,[Q(cat_id__in = my_interest ), ~Q(id__in = fetched )])
  articles = Articles.objects.filter(query)[:10]
  
  request.session['fetched'] = json.dumps( fetched + [x.id for x in articles])
  
  context = {'articles': articles, 'fetched': request.session['fetched']}
  
  return render_to_response('mysite/loadmore.html', context)
  </code></pre>
  
  <p>But I still get the same 10 that was first fetched repeatedly as I scroll to the bottom of the page and if I <code>&lt;p&gt; Fetched: {{fetched}} &lt;/p&gt;</code> on my template I only see <strong>Fetched:</strong></p>