[Templates] TT2, Apache2, mod_perl2, Apache::SessionManager

[prev] [thread] [next] [Date index for 2004/06/10]

From: Mike Whitaker
Subject: [Templates] TT2, Apache2, mod_perl2, Apache::SessionManager
Date: 13:45 on 10 Jun 2004
Having a problem trying to get Apache::SessionManager to work under TT2 
with Apache2/mod_perl2

If I set it up as a PerlTransHandler, nothing happens: as far as I can 
see nothing gets called to set a session cookie, but my_sess.set seems 
to do the right thing. If I set it up as a PerlHeaderParserHandler, I 
get
   Usage: $class->jar($env, $data) at 
/usr/lib/perl5/Apache2/Apache/Cookie.pm line 60.\n
as soon as I try and access any page.

This may, I suspect, not be a TT/Apache::Template issue, but it's kind 
of hard to tell how everything interacts.

Sample page
----
[% USE my_sess = Apache.SessionManager %]
Testing session set.
[% my_sess.set('foo' => 10, 'bar' => 20) %]
<br>
ID is [% my_sess.get('_session_id') %]<br>
The Session Dump
[% USE dumper %]
<PRE>
[% dumper.dump(my_sess.session) %]
</PRE>
<a href=sess2.tt2>Next&gt;</a>
-----
Relevant section of config file:

------
         PerlModule              Apache2
         PerlLoadModule          Apache::Template
         PerlModule              Apache::SessionManager
         PerlTransHandler        Apache::SessionManager

         # set various configuration options, e.g.
         TT2Debug            On
         TT2Trim             On
         TT2PostChomp        On
#       TT2EvalPerl         On
         TT2IncludePath      /usr/cricinfo/templates
         TT2PreProcess       config header
         TT2PostProcess      footer
         TT2Error            error

         # now define Apache::Template as a PerlHandler, e.g.
         <Files *.tt2>
             SetHandler      perl-script
             PerlHandler     Apache::Template
         #   PerlHeaderParserHandler       Apache::SessionManager
             PerlSetVar SessionManagerTracking On
             PerlSetVar SessionManagerExpire 600
             PerlSetVar SessionManagerInactivity 60
             PerlSetVar SessionManagerName TT2SESSIONID
             PerlSetVar SessionManagerDebug 5
             PerlSetVar SessionManagerStore File
             PerlSetVar SessionManagerStoreArgs "Directory => 
/tmp/apache_session_data"
         </Files>
----

Apache-SessionManager-1.01
Apache-Template-2.00_1 (Geoffrey Young's mod_perl2 port)
Template-Plugin-Apache-SessionManager-0.02

TT 2.10 (libtemplate-perl from Debian testing)
Apache 2.0.49 (apache2-mpm-worker from Debian testing)
libapreq2.02-dev (Debian testing)


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

[Templates] TT2, Apache2, mod_perl2, Apache::SessionManager
Mike Whitaker 13:45 on 10 Jun 2004

[Templates] Templates and mod_rewrite.
=?ISO-8859-1?Q?Lo=EFc?= Paillotin 09:22 on 22 Jun 2004

Re: [Templates] Templates and mod_rewrite.
=?ISO-8859-1?Q?Lo=EFc?= Paillotin 09:43 on 22 Jun 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52