How to set Secure Cookie on WSGI applications in python
How to set Secure Cookie on WSGI applications in python With Secure Cookie I mea开发者_StackOverflow社区n one that can be read on only https
The Response.set_cookie
function accepts an optional secure
parameter. Example:
>>> res.set_cookie('key', 'value', max_age=360, path='/',
... domain='example.org', secure=True)
>>> res.headers['Set-Cookie']
'key=value; Domain=example.org; Max-Age=360; Path=/; expires=... GMT; secure'
You can use secure=True
in case you use HTTPS.
See here for more details.
精彩评论