If you want to save cookies in your browser, you can do it with the code below.
print (
'Set-Cookie:{0}={1}; '
'path=/; '
'expires=Fri, '
'5-May-2027 00:00:00 GMT;'.format(key, value))
If you execute it and execute another script, it cannot be saved. The expectation is that the http environment will change.
You can save it by redirecting, so save the cookie and redirect immediately.
Recommended Posts