What is a cookie in Django?

Last updated 3 years, 1 month ago | 1165 views 75     5

Tags:- Django

Django | Cookie 

A cookie is a small piece of information that is stored in the client's browser. It is used to store a user’s data in a file permanently (or for a specified time). Cookie has its expiry date and time and gets removed automatically when it gets expired. Django provides in-built methods to set and fetch cookies.

Here the methods to set and get cookie values are

  • Set_cookie: this method is used to set the values of the cookie
  • Get_cookie: this method is used to get the values of the cookie