I am trying to create a cookie in a bulb. A partial example in the manual:
resp = make_response(render_template(...)) resp.set_cookie('username', 'the username')
Therefore, I implement it as
resp = render_template('show_entries.html', AO_sInteger = session.get('AO_sInteger')) resp.set_cookie('AO_sInteger', AO_sInteger)
Then the system returns with an error:
File "...\Flaskr101.py", line 19, in add_entry resp.set_cookie('AO_sInteger', AO_sInteger) AttributeError: 'unicode' object has no attribute 'set_cookie'
How can I fix this problem?
source share