Code

Opened 6 years ago

Closed 6 years ago

#9096 closed (fixed)

Comment in session middleware doesn't match behaviour

Reported by: SamBull Owned by: nobody
Component: contrib.sessions Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The comment at the beginning of SessionMiddleware's process_response method says, "If request.session was modified, or if response.session was set, save those changes and set a session cookie."

It says that the sessions changes will be saved and a session cookie will be set if response.session was set, but in the code only request.session is ever checked.

I don't know why the session object would be on the response and not on the request. I'm assuming the comment is simply out of date, but I defer to wiser minds.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

There's a reasonable chance that comment is out of date, since it was part of [518]! (The rest of that method is much newer.)

comment:2 Changed 6 years ago by mtredinnick

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

Fixed in [9062].

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.