Code

Opened 5 years ago

Closed 4 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: UI/UX:

Description

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).

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by dj_tw

  • Keywords session added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by mtredinnick

  • milestone 1.0.3 deleted
  • Triage Stage changed from Unreviewed to Design 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 4 years ago by josh

  • Resolution set to worksforme
  • Status changed from new to closed

This issue appears to be resolved already.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.