Opened 10 years ago

Closed 9 years ago

#10455 closed (worksforme)

Session Creation should be Lazy

Reported by: dj_tw Owned by: nobody
Component: contrib.sessions Version: 1.0
Severity: Keywords: lazy creation session
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Sessions should only be created when they are needed.
If sessions are not used, a session entry should not be created.

Memcached-backed sessions seemed to be created, even when the session is not written to.
This is what I'm finding when I look at my memcache after hitting a page that does not use sessions.
Thus, if an app uses sessions (but not much), memcache will fill up with empty sessions from the other web visitors even though their requests don't use sessions.
(the same thing might happen with database-backed sessions putting unneeded rows in the database, but I have not checked that).

Change History (3)

comment:1 Changed 10 years ago by dj_tw

Keywords: session added

comment:2 Changed 10 years ago by Malcolm Tredinnick

milestone: 1.0.3
Triage Stage: UnreviewedDesign decision needed

This is going to be very tricky to organise, since the only way to tell if a particular session key is in use when creating new ones is to check if a session object exists.

(Removing milestone, as it's an enhancement item, not a functionality bug for 1.0.X).

comment:3 Changed 9 years ago by josh

Resolution: worksforme
Status: newclosed

This issue appears to be resolved already.

Note: See TracTickets for help on using tickets.
Back to Top