I will call cookies before all web page. For this reason, I should create value key before all of the page or module is called. Before any of the page is called, cookie should be constructed first, for my case. How can I manage this? Where should I put request.session['id']=Null so that it will called first before any other page is called?
I will call cookies before all web page. For this reason, I should create
Share
You need to write a custom decorator to handle the situation.
You can read more about Decorators here: https://docs.djangoproject.com/en/dev/topics/http/decorators/
For example the
csrf_exemptdecorator allows a request to be processed without the csrf token facility in forms, very useful for JSON based requests.Similarly have a custom decorator for ensuring cooking and use it as:
Writing custom decorators: How to write a custom decorator in django?