views:

304

answers:

2

I've considered CGI::Application and CGI::Session. Of the two, CGI::Session seems more promising. CGI::Application model, however, doesn't look like it would work well with Template Toolkit. (Am I wrong to think so?)

I would like to evaluate more session management libraries, before comitting to one. Any recommendations? I'm looking for a library that's web server agnostic, and works across multiple servers. Catalyst is not an option for now, due to the time required to retrofit existing code into the Catalyst way of doing things.

A: 

I have used Apache::Session with some success. Although the name tells a different story, I don't think it will only work with an Apache webserver.

The nice thing is that you can easily change the way sessions are stored without changing your own session handling code. E.g. you might start out with sessions being stored as files on disk and then move to a DB based system. And then change the DB backend after that.

innaM
I there anything wrong with Apache::Session?
innaM
I don't see what you gain with Apache::Session over CGI::Session/CGI::Application::Plugin::Session, as the advantages you describe for Apache::Session are available for CGI::Session.
MkV
So this makes Apache::Session bad advice and a reason for a downvote?
innaM
CGI::Session is better developed than Apache::Session. Both has some advantages over another.
Alexandr Ciornii
+1 It's an OK answer. Thanks.
GeneQ
+5  A: 

CGI::Application and CGI::Session are very different modules. CGI::Session is a session module - it does not do anything beyond this. CGI::Application is a lightweight framework. It works well with Template Toolkit, some of us use with CGI::Application::Plugin::TT.

So, if you need sessions only, use CGI::Session.

If you need better structure of your code - use CGI::Application. You can even use CGI::Session in it, with CGI::Application::Plugin::Session.

Alexandr Ciornii
Good answer. Just what I wanted to know. ;-)
GeneQ