You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jonathan Swartz <sw...@transbay.net> on 2000/08/01 21:58:37 UTC

Re: template kit.....

Hi Denton --

Many Masonites have successfully used sessions with Mason. It takes about 
five lines of code in the handler.pl to integrate with Apache::Session, 
which will give you all the fancy session handling you need.  Take a look at:

    http://www.masonhq.com/docs/manual/Admin.html#persistent_user_sessions

and the eg/session_handler.pl included in the distribution. This will create 
for you a global %session variable that persists across HTTP requests, 
maintained by cookie. You should also search the Mason mailing list archives
for "session" as quite a few people have written about it.

On the other hand, if you're stuck on URL rewriting, you'll need to either 
implement it yourself, switch to Apache::ASP, or wait for this feature in 
Mason or Embperl.

Cheers
Jon

>Hi there template discussion people,,
>
>I sure think that this template discussion is
>intresting, forms autofill is one thing but another
>thing that i think  would be neat is if the kit could
>do session handling, like the Apache::ASP. Can embperl
>or mason do this fancy stuff.
>
>It´s been a long time since i have done a jobb without
>using sessions. I would really like to have this
>feature included in the kit i´m using and i think alot
>of developers are with me on this one.
>
>Right now i´m using Mason but planing to change to
>Apache::ASP for the easy session handling.
>
>What do you guys think??
>I really like to start a discussion about this how are
>you handling your sessions set/get/save thing.
>
>Yours truly
>Denton River
>Internet Developer 
>Java, Perl, and what else is there......



Re: template kit.....

Posted by Andy Wardley <ab...@cre.canon.co.uk>.
On Aug 1, 12:58pm, Jonathan Swartz wrote:
> Many Masonites have successfully used sessions with Mason. It takes about
> five lines of code in the handler.pl to integrate with Apache::Session,
> which will give you all the fancy session handling you need.

Jonathon makes an important point here.

The "Right Way To Do It", as far as template systems go, is to *not*
re-invent every wheel, but to provide the mechanism for external modules
to be loaded and used.  This is where systems like Mason and TT (to name
just 2) win big.  If you want to add functionality like session management,
database connectivity, custom XML parser, stateful form filling, and so on,
then simply download the relevant module (Apache::Session, DBI, XML::*,
HTML::StickyForms, etc) or write the functionality yourself and then
plug it into the relevant templating system in just a few lines of code.

Template systems shoulds be concerned with processing templates and not
implementing every piece of application functionality that anyone could
ever wish for.


A


-- 
Andy Wardley <ab...@kfs.org>   Signature regenerating.  Please remain seated.
     <ab...@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/