Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14770 closed (wontfix)

Should be able to set cookies from the request as well as the response.

Reported by: pmclanahan Owned by: pmclanahan
Component: Core (Other) Version: master
Severity: Keywords: cookies
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The arguments are laid out quite well in a blog post by David Cramer. In short, one is never sure where in the request-response cycle the need to send a cookie to the browser will arise. It's therefore best, as it's done in many other web frameworks and technologies, to give the developer the ability to do that throughout the view.

David's example code from that blog post, and his subsequently released django-cookies project no longer work as of Django 1.2. I've taken a slightly different approach in my version of his idea, but it still requires a custom middleware to be installed.

I believe this should be a core function of Django. If you agree, please take a look at my patch. I've included tests and docs. Any feedback at all is most welcome.

Attachments (1)

django_ticket_14770.diff (9.8 KB) - added by pmclanahan 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 3 years ago by pmclanahan

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to pmclanahan
  • Patch needs improvement unset
  • Status changed from new to assigned

Changed 3 years ago by pmclanahan

comment:2 Changed 3 years ago by brodie

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 3 years ago by lrekucki

  • Resolution set to wontfix
  • Status changed from assigned to closed

comment:4 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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.