8.4 The SessionAppContext Class

The SessionAppContext class is intended to be used for applications which store state at the server. An inheritance diagram illustrates the relationship to the SimpleAppContext class described above.

Figure: The SessionAppContext class
 
\includegraphics[]{sessionappcontext}

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

Method  Mixin 
add_session_vars(*names) SessionBase
base_url() AppContext
clear_locals() AppContext
current_url() AppContext
decode_session(text) SessionBase
default_session_var(name, value) SessionBase
del_header(name) ResponseMixin
del_session_vars(*names) SessionBase
encode_session() SessionBase
eval_expr(expr) NamespaceMixin
flush_content() ExecuteMixin
flush_html() ExecuteMixin
form_close() NameRecorderMixin
form_open() NameRecorderMixin
get_header(name) ResponseMixin
get_lookup(name) AppContext
get_macro(name) AppContext
get_macro_arg(name) ExecuteMixin
get_tagclass(name) AppContext
get_value(name) NamespaceMixin
has_value(name) NamespaceMixin
has_values(*names) NamespaceMixin
input_add(itype, name, unused_value, return_list) NameRecorderMixin
load_session() SessionServerContextMixin
load_template(name) AppContext
load_template_once(name) AppContext
make_alias(name) NamespaceMixin
merge_request() NameRecorderMixin
pop_content_trap() ExecuteMixin
pop_macro_args() ExecuteMixin
pop_page(target_page) AppContext
push_content_trap() ExecuteMixin
push_macro_args(args) ExecuteMixin
push_page(name, *args) AppContext
redirect(loc) AppContext
redirect_url(loc) AppContext
register_lookup(name, lookup) AppContext
register_macro(name, macro) AppContext
remove_session() SessionServerContextMixin
req_equals(name) AppContext
reset_content() ExecuteMixin
run_template(name) AppContext
run_template_once(name) AppContext
save_session() SessionServerContextMixin
send_content(data) ResponseMixin
send_redirect(loc) ResponseMixin
sesid() SessionServerContextMixin
session_vars() SessionBase
set_globals(dict) NamespaceMixin
set_header(name, value) ResponseMixin
set_page(name, *args) AppContext
set_request(req) AppContext
set_save_session(flag) SessionBase
set_value(name, value) NamespaceMixin
should_save_session() SessionBase
write_content(data) ExecuteMixin
write_headers() ResponseMixin

Externally the execution context is almost identical to that of the SimpleAppContext class. Instead of saving session data in hidden HTML fields, session data is loaded and saved via a session server which is managed by the application.

The class defines a number of extra methods.

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

The app argument is passed to the AppContext constructor.