In response to Compressing data structures for cookies, several people have recommended CGI::Session for managing sessions. The CGI::Session POD itself suggests that users consider Apache::Session as an alternative. Does anyone have any views on the relative merits of the two?
Here are a few points I have gleaned from the documentation:
- Apache::Session (as the name perhaps implies) is designed to work with Apache and mod_perl, but there's no reason why it shouldn't work with CGI. I'm not clear on whether CGI::Session is compatible with Apache/mod_perl.
- CGI::Session has lots of methods to allow storage and recovery of data; Apache::Session simply ties a hash to the data store, and it all happens behind the scenes. Hence Apache::Session seems easier to use (though perhaps less efficient?), while CGI::Session gives the user more control.
- CGI::Session has lots more documentation (but needs it, because of all those methods).
Does anyone have any advice on when it's best to use CGI::Session and when Apache::Session?