开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜