On Fri, 20 Jun 2003 11:38:04 -0400
darren chamberlain <[EMAIL PROTECTED]> wrote:

> I think you might be better off creating an interface to
> Apache::Session, which does not require Apache, despite the name, while
> Apache::SessionManager does require Apache.  The name of the plugin does
> not imply that it is Apache-only, and I think that a general session
> managing plugin will be useful in other contexts.

A simple Template::Plugin::Session plugin can be created (BTW this was my
initial purpose) and I'll do.
However Apache::SessionManager is more than a simple Apache::Session
wrapper because it handles for you the cookie/URI session tracking management
of a web application.

Then I propose these modules:

- Template::Plugin::Apache::SessionManager the TT2 wrapper around 
  Apache::SessionManger
- Template::Plugin::Session the TT2 simple wrapper around Apache::Session,
  without Apache name, to avoid historical CPAN namespace error :-)

So, if you want use TT2 with Apache, you should use directly T::P::A::SM
instead of T::P::S without reinvent the wheel!

Moreover I think that Template::Plugin::Apache::* namespace should be used, 
in the future, for all TT2 plugins that does require mod_perl.

> > Getting multiple session values
> > [% FOREACH s = mysess.get('_session_id','_session_timestamp') %]
> > * [% s %]
> > [% END %]
> 
> What happens when someone does this:
> 
>   [% keys = [ '_session_id' '_session_timestamp' ];
>      FOREACH s = mysess.get(keys) %]
> 
> The listref keys will be stringified, and used as the lookup, because:
> 
>   sub get {
>             my ($self, @args) = @_;
> 
> I'd suggest something more like:
> 
>   sub get {
>       my $self = shift;
>       my @args = ref($_[0]) eq 'ARRAY' ? @{$_[0]} : @_;
> 
> That will catch both types of usage from the template.  I'd modify
> delete() the same way.  You're already doing this type of thing in
> set(), which is good.

I can do it.
 
> Sorry I didn't bring these things up in the discussion on the templates
> list.

Yes, It's better to continue the thread (about code) on the TT2 list! :-)

Thanks for your interest

        - Enrico 

Reply via email to