我正在尝试在烧瓶中创建一个cookie.手册中的部分示例是:
resp = make_response(render_template(...))
resp.set_cookie(’username’, ’the username’)
Run Code Online (Sandbox Code Playgroud)
所以我把它实现为
resp = render_template('show_entries.html', AO_sInteger = session.get('AO_sInteger'))
resp.set_cookie('AO_sInteger', AO_sInteger)
Run Code Online (Sandbox Code Playgroud)
然后系统返回错误:
File "...\Flaskr101.py", line 19, in add_entry
resp.set_cookie('AO_sInteger', AO_sInteger)
AttributeError: 'unicode' object has no attribute 'set_cookie'
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?