Git Product home page Git Product logo

Comments (5)

ziz avatar ziz commented on August 19, 2024

Here is a patch to address this problem:

From 9fab69c4c41bd0376c8b5c01430a646698776b6a Mon Sep 17 00:00:00 2001
From: http://github.com/ziz
Date: Sun, 22 Nov 2009 15:07:25 -0700
Subject: [PATCH] Set cookies during middleware intercept.  It would probably be helpful to compare these cookies to the initial request's cookies and display the differences in the redirect template, since the debug toolbar doesn't otherwise have an opportunity to show them.

---
 debug_toolbar/middleware.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index 5c10f9f..264515e 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -79,10 +79,12 @@ class DebugToolbarMiddleware(object):
             if isinstance(response, HttpResponseRedirect):
                 redirect_to = response.get('Location', None)
                 if redirect_to:
+                    cookies = response.cookies
                     response = render_to_response(
                         'debug_toolbar/redirect.html',
                         {'redirect_to': redirect_to}
                     )
+                    response.cookies = cookies
         if response.status_code == 200:
             for panel in self.debug_toolbars[request].panels:
                 panel.process_response(request, response)
-- 
1.6.4.1

It does not display the cookies set in the redirect page, but at least it addresses the functional problem.

from django-debug-toolbar.

kcbanner avatar kcbanner commented on August 19, 2024

I see this as well.

from django-debug-toolbar.

offbyone avatar offbyone commented on August 19, 2024

I'd like to get in on this; I just wasted 2 hours trying to figure out why my cookies were not being set.

from django-debug-toolbar.

offbyone avatar offbyone commented on August 19, 2024

The patch seems to fix the problem, although it applied with a bit of fuzziness; it's 11 or so lines off of the expected location.

from django-debug-toolbar.

robhudson avatar robhudson commented on August 19, 2024

Fixed on develop branch.

from django-debug-toolbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.