* get_expiry_age
* get_expiry_date
just to override the points where settings.SESSION_COOKIE_AGE is used.
--
Ticket URL: <https://code.djangoproject.com/ticket/28763>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
I've created a pull request: https://github.com/django/django/pull/9314
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:1>
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:2>
* owner: nobody => Tomer Chachamu
* status: new => assigned
* stage: Unreviewed => Accepted
Comment:
That seems useful.
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:3>
* status: assigned => new
* owner: Tomer Chachamu => (none)
* stage: Accepted => Unreviewed
Comment:
Actually, it looks like you can call `SessionStore.set_expiry`? One place
to do so would be in a middleware that's listed below the session
middleware, when processing a response.
{{{
class SessionExpiryPolicyMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
if response.session.modified and response.status_code != 500:
response.session.set_expiry(response.session.calculate_expiry())
return response
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:4>
Comment (by Jaime Herencia Enjuto):
You are right that could be a way to achieve this, I know there are other
ways to do this but don't you think that the responsible of calculating
Session expirations should be the SessionStore not a middleware?
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:5>
Comment (by Tomer Chachamu):
I think it would be worth discussing in the django-developers mailing
list.
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:6>
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
A test should be added so the change isn't inadvertently refactored away.
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:7>
* status: new => assigned
* owner: (none) => Hasan Ramezani
* needs_tests: 1 => 0
Comment:
[https://github.com/django/django/pull/11389 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9d6f981a66bd2c4188c4a3e08e4f36fc9c4882ef" 9d6f981a]:
{{{
#!CommitTicketReference repository=""
revision="9d6f981a66bd2c4188c4a3e08e4f36fc9c4882ef"
Fixed #28763 -- Allowed overriding the session cookie age with
SessionStore.get_session_cookie_age().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28763#comment:9>