MCPcopy
hub / github.com/django/django / session

Method session

django/test/client.py:808–817  ·  view source on GitHub ↗

Return the current session variables.

(self)

Source from the content-addressed store, hash-verified

806
807 @property
808 def session(self):
809 """Return the current session variables."""
810 engine = import_module(settings.SESSION_ENGINE)
811 cookie = self.cookies.get(settings.SESSION_COOKIE_NAME)
812 if cookie:
813 return engine.SessionStore(cookie.value)
814 session = engine.SessionStore()
815 session.save()
816 self.cookies[settings.SESSION_COOKIE_NAME] = session.session_key
817 return session
818
819 async def asession(self):
820 engine = import_module(settings.SESSION_ENGINE)

Callers

nothing calls this directly

Calls 2

saveMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected