You linked to the wrong PR, here's the right one: https://github.com/django/django/pull/9318
I think Tim's middleware solution isn't that bad, it has the advantage that you can do a lot more logic there too, like use other attributes of request. Plus it works on current Django releases. That said the patch is small and it also makes SessionBase and I can see the logic in centralizing the settings access, so I'm not against it. On 6 November 2017 at 19:40, Jaime Herencia <[email protected]> wrote: > If I want to make dynamic my SESSION_COOKIE_AGE setting based on certain > parameters of the session I need to reimplement in my SessionStore > subclasses the following methods: > > - get_expiry_age > - get_expiry_date > > just to override the points where settings.SESSION_COOKIE_AGE is used. > > I've created a pull request <https://github.com/django/django/pull/9314> > and a ticket <https://code.djangoproject.com/ticket/28763> where, as you > can see, I was told that this could be done via a Middleware but I think > that the responsibility of calculating Session expirations should be in the > SessionStore by default, so it should be easy to subclass them to change > that. > > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" 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]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-developers/a0225091-86c4-471c-9205- > 793175a2280e%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/a0225091-86c4-471c-9205-793175a2280e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM2fYXcr%2BqKk3hGYoWTGeSPVPVwvBEEKs-tW2p_qCOPqKw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
