How does get_user make sure that the session is still valid (not expired)?
#2077
-
|
In the docs it is mentioned that we should periodically check with From: https://asgi.readthedocs.io/en/latest/specs/main.html So my (naive) understanding is that a connection is started, and the session is put into Lines 20 to 55 in b6dc8c1 which does the following:
but it does not check that the session has expired, i.e. in the following case:
So until the user closes their websocket connection, Or is there some other mechanism that ensures the auth hash changes once a session is expired? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
If you're dealing with short-lived sessions you can check the session's expire_date, or you can refresh the session in the (I suspect periodically calling |
Beta Was this translation helpful? Give feedback.
If you're dealing with short-lived sessions you can check the session's expire_date, or you can refresh the session in the
scope(similarly to refetching the user).(I suspect periodically calling
session.save()is going to be the simplest way forward, but it depends on your exact use-case 🤔)