A two-part middleware which modifies request.COOKIES and adds a set and delete method.
set
matchesdjango.http.HttpResponse.set_cookie
delete
matchesdjango.http.HttpResponse.delete_cookie
Just modify your MIDDLEWARE_CLASSES
setting, order is important here!
- :
- MIDDLEWARE_CLASSES = (
- 'djcookies.CookieMiddleware', ...
)
- def my_view(request):
- request.COOKIES.set([args]) ... return response