Here's how to set a cookie.
response.set_cookie(key="mykey", value="myvalue")
Here's how to read the cookie.
if "mykey" in request.COOKIES:
read_value = request.COOKIES["mykey"]
That's it. Have fun with cookies.
Reference : http://docs.djangoproject.com/en/dev/ref/request-response/
No comments:
Post a Comment