Electronics & Programming


Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 12, 2011 18:01:03

Adam E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Test cookie and CSRF middleware

I'm migrating a site from Django 1.1 to 1.2 and I can't figure out how
set_test_cookie and test_cookie_worked is supposed to work when using
the CSRF middleware.

I do request.session.set_test_cookie() in my login view, then on POST,
I want to check request.session.test_cookie_worked(), but I never get
the chance, because when cookies are disabled, the CSRF middleware
kicks in and fails with "No CSRF or session cookie." That's not a
surprise, and it's certainly true, but I can't figure out any way to
get to a point where I can check for the test cookie and give a
"cookies required" message.

I feel like I'm missing something painfully obvious here. Help?

You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.


Board footer

Moderator control

Enjoy the 20th of March

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support