Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django cookies

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
 
PREVIOUS NEXT
Tagged: #django #cookies
ADD COMMENT
Topic
Name
4+5 =