Closed humiaozuzu closed 9 years ago
This feature is added in Flask
version 1.0 which is not released yet.
It seems we need to add it to our extension, :)
我自己稍微修改了下这个功能,用了 SESSION_REFRESH_INTERVAL
参数控制多少次请求后才会刷新一下 session,用的 random 函数。因为完全不刷新和每次都不刷新都不太好。
@humiaozuzu I would consider adding our own should_set_cookie
feature.
in the newest version of flask, flask use a config param called SESSION_REFRESH_EACH_REQUEST, which default value is True, it is used to control "should_set_cookie". When it is False, flask won't set cookie in every response. In flask_session, this code is commented, so the SESSION_REFRESH_EACH_REQUEST won't work, can you support this config param?
因为自己并不需要每一次请求的时候都更新 session 的有效期