def setCookie(request):
response = render(request,"index.html")
maxAge = 1 * 24 * 60 * 60
response.set_cookie("key", "value", max_age = maxAge) # max_age = 1 day
def getCookie(request):
value = request.COOKIES.get('key')
if value is None:
# Cookie is not set