Flask-Login not working with two applications on same domain

故事扮演 提交于 2019-12-02 05:43:47

问题


I have been using Flask-Login on <domain>/<app_1> for almost a year without issue. Recently, I built a second application with the same stack and deployed it to <domain>/<app_2>. Now, whenever I log into either app, it kicks me out of the other. Is there a reason for this? The apps have different databases and secret keys, and I would have assumed I could have two cookies for the same domain.

I'm not too familiar with cookies and am not sure how to debug this. I'm happy to provide headers or other information if people can tell me what is relevant.


回答1:


You need to configure the cookies to use separate paths.

app.config['REMEMBER_COOKIE_PATH'] = '/app_1'


来源:https://stackoverflow.com/questions/40440691/flask-login-not-working-with-two-applications-on-same-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!