Hi all, 

I've written a Template Toolkit plugin in order to integrate session management 
under Apache/mod_perl environment using Apache::SessionManager CPAN module
(a mod_perl - framework independent - HTTP session manager wrapper over 
Apache::Session).

I've called the plugin Template::Plugin::SessionManager.

Simple usage in a tt2 template:

[% USE mysess = SessionManager %]

Getting single session value
ID is [% mysess.get('_session_id') %]

Getting multiple session values
[% FOREACH s = mysess.get('_session_id','_session_timestamp') %]
* [% s %]
[% END %]

Getting all session values
[% FOREACH s = mysess.get %]
* [% s %]
[% END %]

Setting session values:
[% mysess.set('foo' => 10, 'bar' => 20, ...) %]

Deleting session value(s)
[% mysess.delete('foo', ...) %]

Destroying session
[% mysess.destroy %]


You can get the module here:

        http://pisa.pm.org/Template-Plugin-Session-0.01.tar.gz

I've already discussed this name in TT2 ML and directly with TT2's author 
(Andrew Warldey) and the (little) question is if all Apache::* modules will have 
to live under Template::Plugin::Apache:: namespace.
The conclusion is that there is not convention about TT2 plugins name 
(for example MP3::Info wrapper is T::P::MP3 and not T::P::MP3::Info and so on)
so I've chosen shorter, with the Andrew's agreement, of course.

I send this mail in order to notify you this, before I send
it off to CPAN. Please, let me know if there are some problems.
Also suggestions about the namespace are welcome.

Thanks in advance. 

by 

        - Enrico

Reply via email to