(self)
| 32 | return self.cache_key_prefix + await self._aget_or_create_session_key() |
| 33 | |
| 34 | def load(self): |
| 35 | try: |
| 36 | data = self._cache.get(self.cache_key) |
| 37 | except Exception: |
| 38 | # Some backends (e.g. memcache) raise an exception on invalid |
| 39 | # cache keys. If this happens, reset the session. See #17810. |
| 40 | data = None |
| 41 | |
| 42 | if data is None: |
| 43 | s = self._get_session_from_db() |
| 44 | if s: |
| 45 | data = self.decode(s.session_data) |
| 46 | self._cache.set( |
| 47 | self.cache_key, data, self.get_expiry_age(expiry=s.expire_date) |
| 48 | ) |
| 49 | else: |
| 50 | data = {} |
| 51 | return data |
| 52 | |
| 53 | async def aload(self): |
| 54 | try: |
nothing calls this directly
no test coverage detected