4
@user.route('/login', methods=['POST'])
def check_oauthuser():
token = request.args.get('token','')
open_u_id = request.args.get('openUId','')
_self_expires = 60 * 60 * 24 * 30 * 3
#re = Response()
#re.set_cookie('name','1111111')
if token!='' and open_u_id!='':
set_user_login_cache(user_id, token)
return jsonify(state=0,msg='success')
我想設置一個cookie到響應頭,但我用jsonify
而不是創建一個Response
。如何在返回jsonify
時添加cookie?使用jsonify時可以設置cookie嗎?