在局域网测试,一般都是ok的.但是以上服务器测试,手机的app就经常爆出这个问题.
而在局域网内,app端更换自己的局域网ip **一定**会爆出这个问题,在此种情境下,我print 了cookies和session,发现都没变.
大家是怎么处理这块的?
谢谢.
而在局域网内,app端更换自己的局域网ip **一定**会爆出这个问题,在此种情境下,我print 了cookies和session,发现都没变.
大家是怎么处理这块的?
谢谢.
1
hahastudio Nov 27, 2014
|
2
glasslion Nov 27, 2014
You can configure session protection on the LoginManager, and in the app’s configuration. If it is enabled, it can operate in either basic or strong mode. To set it on the LoginManager, set the session_protection attribute to "basic" or "strong":
login_manager.session_protection = "strong" Or, to disable it: login_manager.session_protection = None By default, it is activated in "basic" mode. It can be disabled in the app’s configuration by setting the SESSION_PROTECTION setting to None, "basic", or "strong". When session protection is active, each request, it generates an identifier for the user’s computer (basically, the MD5 hash of the IP address and user agent). If the session does not have an associated identifier, the one generated will be stored. If it has an identifier, and it matches the one generated, then the request is OK. |
3
gkiwi OP |