[英]Django REST API - How to stay “logged in” on refresh?
I am using DJANGO Rest API and an AngularJS client and I cannot figure out how to remain logged in when I refresh the page! 我正在使用DJANGO Rest API和AngularJS客户端,无法弄清刷新页面后如何保持登录状态! (Django does this when they render html on their back-end stuff)...
(Django在其后端内容上呈现html时执行此操作)...
I have authtoken and my default auth classes are: 我有authtoken,我的默认auth类是:
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication'
I have ng-Cookies in AngularJS and I've tried a few things I've read online about keeping headers and such but nothing has seemed to work. 我在AngularJS中使用ng-Cookies,并且尝试了一些在线阅读的有关保留标头的内容,但似乎没有任何效果。 :(
:(
Ideas? 想法?
因此,这听起来很愚蠢,但是请确保您设置为保留令牌的cookie没有标记为'csrftoken':)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.