flask-security 使用户始终登录
flask-security make user always signed in
我正在努力使特定用户始终使用 flask 安全扩展登录。
我找不到这方面的任何文档。
有人可以指出我开始的正确方向吗?
https://flask-login.readthedocs.io/en/latest/#cookie-settings
“Remember Me” functionality can be tricky to implement. However, Flask-Login makes it nearly transparent - just pass remember=True to
the login_user call. A cookie will be saved on the user’s computer,
and then Flask-Login will automatically restore the user ID from that
cookie if it is not in the session. The cookie is tamper-proof, so if
the user tampers with it (i.e. inserts someone else’s user ID in place
of their own), the cookie will merely be rejected, as if it was not
there.
REMEMBER_COOKIE_DURATION
The amount of time before the cookie expires, as a datetime.timedelta
object. Default: 365 days (1 non-leap Gregorian year)
我正在努力使特定用户始终使用 flask 安全扩展登录。
我找不到这方面的任何文档。 有人可以指出我开始的正确方向吗?
https://flask-login.readthedocs.io/en/latest/#cookie-settings
“Remember Me” functionality can be tricky to implement. However, Flask-Login makes it nearly transparent - just pass remember=True to the login_user call. A cookie will be saved on the user’s computer, and then Flask-Login will automatically restore the user ID from that cookie if it is not in the session. The cookie is tamper-proof, so if the user tampers with it (i.e. inserts someone else’s user ID in place of their own), the cookie will merely be rejected, as if it was not there.
REMEMBER_COOKIE_DURATION
The amount of time before the cookie expires, as a datetime.timedelta object. Default: 365 days (1 non-leap Gregorian year)