#9548 closed (fixed)
Cache Backend for Sessions doesn't handle Empty Session State
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.sessions | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The exists method in the SessionStore in the cache backend's test returns a session does not exist if nothing is stored in the session. I'm am trying to develop a site that just uses the SessionMiddleware to track visitors and doesn't actually store anything in the session. This will potential create collisions with existing visitors since exists() will return that the newly generated session key is available when it actually is not...
Change from:
def exists(self, session_key): if self._cache.get(session_key): return True return False
To:
def exists(self, session_key): if self._cache.has_key(session_key): return True return False
Change History (4)
comment:1 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
(In [9934]) Fixed #9548 -- Correctly detect existence of empty sessions with cache backend.