#20936: When logging out/ending a session, don't create a new, empty session
-------------------------------------+-------------------------------------
     Reporter:  mattrobenolt         |                    Owner:
         Type:                       |  mattrobenolt
  Cleanup/optimization               |                   Status:  assigned
    Component:  contrib.sessions     |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  session, logout,     |             Triage Stage:  Accepted
  auth                               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by mattrobenolt):

 * status:  new => assigned
 * needs_better_patch:  0 => 1
 * owner:  nobody => mattrobenolt


Comment:

 You are right, mostly. It's desirable to set the {{{_session_key}}} to
 {{{''}}} because that tells the browser to effectively remove the data.
 Then the step that I've missed, is sending it back an expiry time in the
 past. So basically {{{time.time() - 1}}}. I hope that makes sense. The
 combination of those two will tell the browser to actually delete the
 cookie.

 With these combined, the {{{process_response}}} will behave correctly. I'm
 going to spend a little more time on this to get it to set an expiry to a
 date in the past. While I'm at it, I'm going to check out what Django does
 when you explicitly delete cookies anyways. I have a hunch that this is
 all behaving slightly wonky, but I don't know for sure off thet op of my
 head.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20936#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.3bbc7fa1af766192a9b490d60f5c3e00%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to