MCPcopy
hub / github.com/django/django / load

Method load

django/contrib/sessions/backends/signed_cookies.py:6–24  ·  view source on GitHub ↗

Load the data from the key itself instead of fetching from some external data store. Opposite of _get_session_key(), raise BadSignature if signature fails.

(self)

Source from the content-addressed store, hash-verified

4
5class SessionStore(SessionBase):
6 def load(self):
7 """
8 Load the data from the key itself instead of fetching from some
9 external data store. Opposite of _get_session_key(), raise BadSignature
10 if signature fails.
11 """
12 try:
13 return signing.loads(
14 self.session_key,
15 serializer=self.serializer,
16 # This doesn't handle non-default expiry dates, see #19201
17 max_age=self.get_session_cookie_age(),
18 salt="django.contrib.sessions.backends.signed_cookies",
19 )
20 except Exception:
21 # BadSignature, ValueError, or unpickling exceptions. If any of
22 # these happen, reset the session.
23 self.create()
24 return {}
25
26 async def aload(self):
27 return self.load()

Callers 1

aloadMethod · 0.95

Calls 3

createMethod · 0.95
loadsMethod · 0.45

Tested by

no test coverage detected