#21514: Session expiry dates should be in an ISO string instead of datetime
----------------------------------+------------------------------------
     Reporter:  n142857@…         |                    Owner:  nobody
         Type:  Bug               |                   Status:  new
    Component:  contrib.sessions  |                  Version:  1.6
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Matt Riviere):

 If serializing/unserializing is handled within set_expiry() and
 get_expiry_date/age(), the majority of user code should be unaffected. In
 particular, what prasoon2211 mentioned would not be a problem, because the
 db session adapter use get_expiry_date(), so it wouldn't even see the
 change. session!['_expiry_date'] can already be either an int, a datetime,
 or None, so adding an option to let it be an ISO8601 string doesn't seem
 that bad.

 The only thing that would break, is if someone is accessing
 session!['_expiry_date'] directly (or parsing the stored session data from
 outside django entirely) and expects to find a datetime. Nothing within
 django does it. No idea how much outside code is doing it. It is probably
 possible to keep backwards compatibility on that by serializing to ISO8601
 only for non-pickle serializer but that seems to complicate things a bit
 too much.

--
Ticket URL: <https://code.djangoproject.com/ticket/21514#comment:6>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.85b820830013d85409e9613e088b499d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to