I have a cookie that has been defined:
SESSION_COOKIE_AGE = 3600
And I would like to warn the user when it will expire.
What is the best way?
I have a cookie that has been defined:
SESSION_COOKIE_AGE = 3600
And I would like to warn the user when it will expire.
What is the best way?
You can extract the expiration date of the session from the template with:
{{ request.session.get_expiry_date }}
You only need a little bit of js to show the warning to the user when the date approaches.
But you can always use AJAX and create a view where you can check with js. In the view you would do something similar:
caducidad = request.session.get_expiry_date()