1,854 questions
Write then read a cookie in Python
Nigel Wright
291
Reputation points
I need to store a cookie on client side then read it back to update information then send it again.
My code passes syntax ok and runs with no errors but doesnt read/write the cookies
def readcookiestring() :
cname = 'nigel1234567890'
global cookiestring
cookiestring = ""
try:
res=make_response()
cookiestring = request.cookies.get(cname)
except Exception as e:
messagebox.showinfo("rd ",e)
messagebox.showinfo("rd ",cookiestring)
return
def writecookiestring():
global cookiestring
cookiestring="a string"
cname = 'nigel1234567890'
try:
res = make_response()
res.set_cookie(cname, "cookiestring")
except Exception as e:
messagebox.showinfo("wr ",e)
return
Windows for business Windows Client for IT Pros Devices and deployment Other
Sign in to answer