question

69673825 avatar image
0 Votes"
69673825 asked

Write then read a cookie in Python

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-hardware-code-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers