8.5.3 The SimpleSessionFileApp Class

The SimpleSessionFileApp class is intended for use in monolithic applications (page objects instead of page modules). Session state is stored in the file system at the server.

Figure: The SimpleSessionFileApp class
 
\includegraphics{simplesessfileapp}

The methods available in SimpleSessionFileApp and the location of their definition are show below.

Method  Mixin 
base_url() Application
create_context() SimpleSessionFileApp
del_session(sesid) SessionFileAppMixin
display_response(ctx) PageObjectMixin
format_exception() Application
get_lookup(name) ResourceMixin
get_macro(name) ResourceMixin
get_session(sesid) SessionFileAppMixin
get_tagclass(name) ResourceMixin
handle_exception(ctx, req) Application
is_page_module(name) PageObjectMixin
load_page(ctx) PageObjectMixin
load_session(ctx) Application
load_template(name) CachingTemplateLoaderMixin
load_template_once(name) CachingTemplateLoaderMixin
merge_request(ctx) Application
new_session() SessionFileAppMixin
page_enter(ctx, args) PageObjectMixin
page_leave(ctx) PageObjectMixin
pickle_sign(text) PickleSignMixin
pickle_unsign(text) PickleSignMixin
process_request(ctx) PageObjectMixin
put_session(sesid, text) SessionFileAppMixin
register_lookup(name, lookup) ResourceMixin
register_macro(name, macro) ResourceMixin
register_page(name, obj) PageObjectMixin
register_tagclasses(*tags) ResourceMixin
remove_session(ctx) Application
run(req) Application
save_session(ctx) Application
ses_age() SessionFileAppMixin
ses_appid() SessionFileAppMixin
start_page() PageObjectMixin
template_traceback(tb) Application
validate_request(ctx) Application

The SimpleSessionFileApp class defines the following methods:

__init__( base_url, template_path, start_page, secret, session_appid, session_dir)
When you inherit from the SimpleSessionFileApp class you must call this constructor.

The base_url argument is used as the base for URLs produced by the <al-a> and <al-form> tags. The template_path defines the root directory where template files are loaded from. The start_page identifies the first page that will be served up in a new browser session. The secret argument is used to MD5 sign all pickles sent to the browser.

The session_appid argument identifies the session application in the browser cookie. Multiple applications can share sessions by using the same identifier here. The session_dir argument defines the directory in which the application will store session files.

create_context( )
Returns a new instance of the SessionFileAppContext class.