我在基于Flask的应用程序中使用Beaker和Memcached进行会话管理,但我得到的是" AttributeError:' Session'对象没有属性' permanent'"有时在用户会话处于活动状态时注销用户。 见下面的错误
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask/templating.py", line 126, in render_template
ctx.app.update_template_context(context)
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask/app.py", line 716, in update_template_context
context.update(func())
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask_login.py", line 826, in _user_context_processor
return dict(current_user=_get_user())
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask_login.py", line 795, in _get_user
current_app.login_manager._load_user()
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask_login.py", line 340, in _load_user
deleted = self._session_protection()
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/flask_login.py", line 383, in _session_protection
if mode == 'basic' or sess.permanent:
File "/home/hirealchemy/hirealchemy_v2/local/lib/python2.7/site-packages/beaker/session.py", line 663, in __getattr__
return getattr(self._session(), attr)
AttributeError: 'Session' object has no attribute 'permanent'