7.7.3 HiddenFieldSessionMixin

Saves session state to a hidden field named __albstate__ at the end of every form produced by <al-form> tags.

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

encode_session( )
Extends the base class encode_session() method to zlib.compress() and base64.encodestring() the result. This makes the session data suitable for placing in a hidden field in the HTML.

load_session( )
This is called from the Application class load_session() method. The session state is retrieved from the browser request, decoded and decompressed then passed to the decode_session() method.

save_session( )
This is called from the Application class save_session() method at the end of the request processing sequence. The method does nothing because the session state is saved in hidden fields in the HTML.

form_close( )
Called just before the <al-form> tag is closed. If the session is flagged to be saved a hidden field named __albstate__ is written to the output.

Note that this method is also present in the RecorderMixin, so if you inherit from the HiddenFieldSessionMixin class you must define a form_close() method in the derived class which calls this method in both of the super classes.