title: Django: Cookie set to expire in 30 seconds is actually expiring in 30 minutes?
body: <p>This is my code: </p>
  
  <pre><code>def update_session(request):
      if not request.is_ajax() or not request.method=='POST':
         return HttpResponseNotAllowed(['POST'])
      user_id = request.POST.get('u')
      hr = set_terminal_cookie(user_id)
      return hr
  
  def set_terminal_cookie(user_id):
      print 'set_terminal_cookie'
      hr = HttpResponse('ok')
      print datetime.datetime.now()
      expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=30)
      print expiry_time
      hr.set_cookie('user_id', user_id, expiry_time)
      return hr 
  </code></pre>
  
  <p>This is the log output: </p>
  
  <pre><code>set_terminal_cookie
  2011-04-05 23:16:36.706624
  2011-04-05 23:17:06.706806
  </code></pre>
  
  <p>However, if I then check the 'user_id' cookie in Firefox, the 'Expires' date is:</p>
  
  <pre><code>Tue Apr 5 23:50:07 2011
  </code></pre>
  
  <p>What am I doing wrong?</p>