-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* Enrico Sorcinelli <enrico at sorcinelli.it> [2003-06-20 10:29]:
> 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 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.

> 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.

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

(darren)

- -- 
The Net inteprets censorship as damage and routes around it.
    -- John Gilmore
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+8ypczsinjrVhZaoRAoiJAJ4zm5VF3kEvYa0/W3GMoDVvuThJoQCfQ82g
G49+dGQHzC2toisG/yPjuQk=
=QApM
-----END PGP SIGNATURE-----

Reply via email to