How to get how many seconds are left before session expiration django

Viewed 27

In Django I can set the expiration time for the session

request.session.set_expiry(300)

and after 5 minutes the session ends.

When a user makes a request for a view, I want to be able to check how many seconds are left in the current session before it expires. The following method

request.session.get_expiry_age()

is returning 300 instead of the seconds left.

Is there anyway to get the seconds left in a session before it expires?

0 Answers
Related