我正在使用python aiohttp库编写一个web服务器。
如何设置cookie,然后在一个响应中将用户重定向到另一个页面?
可以使用aiohttp.web.HTTPSeeOther重定向用户,但我找不到将cookies附加到它的方法。
发布于 2017-02-16 14:10:25
只需设置响应的cookie值。
import aiohttp
response = aiohttp.web.HTTPSeeOther(<location>)
response.cookies['test'] = '1'
return responsehttps://stackoverflow.com/questions/42241424
复制相似问题