Apache::AxKit::Plugin::BasicSession - AxKit plugin that handles setting / loading of Sessions
AxAddPlugin Apache::AxKit::Plugin::BasicSession AxAddPlugin Apache::AxKit::Plugin::AddXSLParams::BasicSession PerlSetVar BasicSessionDataStore "File" PerlSetVar BasicSessionArgs "Directory => /tmp/session"
BasicSession is an AxKit plugin which automatically creates and manages server-side user sessions. Based on Apache::Session::Flex, this allows you to specify all the parameters normally configurable through A:S::Flex.
NOTE: If used in conjunction with the provided AxKit::XSP::BasicAuth module, the following parameter's names should be changed to reflect your local realm name. For instance, "BasicSessionDataStore" should be changed to say "RealmNameDataStore". This allows for different configuration parameters to be given to each realm in your site.
Sets the backend datastore module. Default: DB_File
Sets the record locking module. Default: Null
Sets the session id generation module. Default: MD5
Sets the hash serializer module. Default: Storable
Comma-separated list of name/value pairs. This is used to pass additional parameters to Apache::Session::Flex for the particular modules you select. For instance: if you use MySQL for your DataStore, you need to pass the database connection information. You could pass this by calling:
PerlSetVar BasicSessionArgs "DataSource => dbi:mysql:sessions, \ UserName => session_user, \ Password => session_password"
While BasicSession defaults to using a cookie for sessions, there are times (e.g. when performing
document() lookups within XSLT stylesheets) when it is not possible to supply the proper cookie information with an HTTP request.
Therefore, you can use this configuration variable to set the name of a query parameter where the session ID can be found. This is not required, but will be used in preference to a cookie if this query parameter is supplied.
Note, however, that the W3C recommends against using this for external requests.
These arguments set the parameters your session cookie will be created with. These are named similarly to the above parameters, namely the prefix should reflect your local realm name (or "BasicSession" if you aren't doing authentication). A common thing one might want to set is the expirytime of the session cookie. This can be set using the formats described in CGI::Cookie, e.g.:
PerlSetVar BasicSessionCookieExpires +2d
will make the cookie expire two days from now.
For more information, please see Apache::AuthCookie.
This plugin was created to complement AxKit::XSP::BasicSession, but can be used without the taglib.
Every session access, the session key "_last_accessed_time" is set to the current date-timestamp. When a new session is created, the session key "_creation_time" is set to the current date-timestamp.
To tell you the truth, I haven't tested this enough to know what happens when it fails. I'll update this if any glaring problems are found.
Michael A Nachbaur, firstname.lastname@example.org Kjetil Kjernsmo, email@example.com
Copyright (c) 2001-2004 Michael A Nachbaur, 2004 Kjetil Kjernsmo. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.