Flask组件之Flask-session

Posted bad-robot

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Flask组件之Flask-session相关的知识,希望对你有一定的参考价值。

1、Flask模块中session与Flask-session组件中session的继承关系:

  Flask模块sessions.py:

class SessionInterface(object):
    def open_session(self, app, request):
        raise NotImplementedError()

    def save_session(self, app, session, response):
        raise NotImplementedError()

class SecureCookieSessionInterface(SessionInterface):
    def open_session(self, app, request):
        pass

    def save_session(self, app, session, response):
        pass

  flask-session组件sessions.py:

class SessionInterface(FlaskSessionInterface):
    pass

class NullSessionInterface(SessionInterface):
    pass
    
class RedisSessionInterface(SessionInterface):
    pass
    
class MemcachedSessionInterface(SessionInterface):
    pass
    
class FileSystemSessionInterface(SessionInterface):
    pass
    
class MongoDBSessionInterface(SessionInterface):
    pass
    
class SqlAlchemySessionInterface(SessionInterface):
    pass

 

以上是关于Flask组件之Flask-session的主要内容,如果未能解决你的问题,请参考以下文章

Flask之flask-session

Flask之flask-session

flask之三方组件

Flask之Flask-Session 򁄘

Flask之Flask-Session -- 2019-08-11 19:38:31

flask-session组件