7.7.5 SessionFileContextMixin

This class works in concert with the SessionFileAppMixin application mixin class to store session data in the local file-system. All management of session data storage is performed by the application class.

Inherits from the SessionBase class so you must call the constructor if you subclass this class.

__init__( )
When you inherit from the SessionFileContextMixin class you must call this constructor.

sesid( )
Returns the session id.

load_session( )
This is usually called from the Application class load_session() method. Retrieves the session id and then either retrieves an existing session or creates a new session via the application object.

If an existing session is retrieved it is passed to the decode_session() method (inherited from the superclass). If an exception is raised during decode_session() then the session will be deleted from the server and a new session will be created via the application object new_session() method.

save_session( )
This is called from the Application class save_session() method at the end of the request processing sequence. If the session save flag has been cleared via the set_save_session() method then the session is not saved.

Before saving a session the method calls the superclass encode_session() then calls the put_session() application method to save the session.

remove_session( )
This is called from the Application class remove_session() method. The method calls the superclass remove_session() then calls the del_session() application method to remove the session at the server.