Mark Stosberg wrote:
Since so many of us use DBI database handles and session management, I
would love to see some plug-in modules to add these kind new methods.
Perhaps something in the spirit of ::ValidateRM would work. (I think
that technique is called "mix-in" module.

Well, I found a couple of spare hours late last night and threw together a CGI::Application::Session module that provides CGI::Session support for CGI::Application. It works in a similar way that CGI::Application::ValidateRM does (in fact I used much of the structure of that module as a base... thanks Mark).


The module is simple to use. Just add 'use CGI::Application::Session;' to your base class or your runmode module, and you have access to a $self->session method/object. Then all you need to do is set an outgoing cookie with the session ID (this could be done automatically once the header_props patches make it into the CGI::Application core). See the docs for more config options and examples.

I haven't put this on CPAN, because I would like some comments on the usefulness of this module, and more importantly, on the implementation... Also, what about the name (should there be a CGI::Application::Plugin:: namespace for modules like this and CGI::Application::ValidateRM?) What if someone wants to create a CGI::Application::Session module based on Apache::Session?

Anyway, here is the module:

http://cees.crtconsulting.ca/perl/modules/CGI-Application-Session-0.01.tgz

Cheers,

Cees


--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to