![]() |
![]()
| ![]() |
![]()
NAMECatalyst::Plugin::Session::Store - Base class for session storage drivers. SYNOPSISpackage Catalyst::Plugin::Session::Store::MyBackend; use base qw/Catalyst::Plugin::Session::Store/; DESCRIPTIONThis class doesn't actually provide any functionality, but when the "Catalyst::Plugin::Session" module sets up it will check to see that "YourApp->isa("Catalyst::Plugin::Session::Store")". When you write a session storage plugin you should subclass this module for this reason. This documentation is intended for authors of session storage plugins, not for end users. WRITING STORE PLUGINSAll session storage plugins need to adhere to the following interface specification to work correctly: Required Methods
Error handlingAll errors should be thrown using Catalyst::Exception. Return values are not checked, and are assumed to be OK. Missing values are not errors. Auto-Expiry on the BackendStorage plugins are encouraged to use "$c->session_expires", "$c->config('Plugin::Session' => { expires => $val })", or the storage of the "expires:$sessionid" key to perform more efficient expiration, but only for the key prefixes "session", "flash" and "expires". If the backend chooses not to do so, Catalyst::Plugin::Session will detect expired sessions as they are retrieved and delete them if necessary. Note that session store that use this approach may leak disk space, since nothing will actively delete an expired session. The "delete_expired_sessions" method is there so that regularly scheduled maintenance scripts can give your backend the opportunity to clean up. Early FinalizationBy default the main session plugin will finalize during body finalization which ensures that all controller code related to the session has completed. However some storage plugins may wish to finalize earlier, during header finalization. For example a storage that saved state in a client cookie would wish this. If a storage plugin wants to finalize early it should set $c->_needs_early_session_finalization to true. Please note that if you do this in a storage plugin, you should warn users not to attempt to change or add session keys if you use a streaming or socket interface such as $c->res->write, $c->res->write_fh or $c->req->io_fh.
|