On Thursday, January 30, 2003, at 01:30 PM, Ken Williams wrote:
I was quite certain that at one point Apache::Session was not working with the Apache/Perl combo that came with OS X. In any case, now that we know it does work, it is a moot issue. Thanks for letting me know that you use it without any problem. I will try it today.On Thursday, January 30, 2003, at 09:25 AM, Puneet Kishor wrote:A long while back I asked a similar question -- how do I make state management possible with Perl and Apache, specifically on MacOS X, but ideally in a platform independent kind of way. At that time I believe Apache::Sessions was not compatible with OS X. I haven't found any statement now contradicting that.I don't remember any problem with Apache::Session on OS X. It certainly works fine now, I'm using it.
I really wish the developer(s) would not write in their READMEs in such a manner that it might be taken to mean that it requires mod_perl (darn, that was a labored sentence I just wrote).Even if Apache::Sessions did work on OS X, does it _require_ mod_perl? I don't have mod_perl, I don't want to install mod_perl (for now at least), and I certainly don't want to create a solution that _requires_ mod_perl, because the users of my solution may not have mod_perl. Additionally, I don't want to mess with Apple's perl, and as much as possible, I want to use that rather than install my own.The name "Apache::Session" is actually sort of a bad name for it - it doesn't really *require* mod_perl, it's just used most of the time in that context. You could probably get by fine with it.
Funny, now that I started looking around on CPAN, I see so many similar modules... CGI::Persistence and its various incarnations were mentioned here, then there is CGI::FormMagick (clever name), and now you mention Cache::Cache. I will look that up. I wish there was something out of the box in Perl that provided this function.
However, you might be happier just using Cache::Cache instead, if you're not going to do any mod_perl interaction. Some people even use Cache::Cache under mod_perl. Maybe you could see if that fills your needs too.
You know, I would love to find out the break-out figures on how much of the community uses Perl for web vs. other tasks. If web use for Perl is (now) more than other use, it would make sense to start building web friendly stuff in stock perl, beyond CGI.pm, that is. Or maybe there could be made a special-for-web edition of Perl complete with state mgt., caching, mod_perl kinda things, etc., and in a really easy to install and configure package. That would prevent new-comers like PHP from eating in Perl's share.
Sorry, my bad. I should not have stated that the way I did. Of course I would have to do that (but why do you say "DON'T do that" for session key as a POST arg?). Unless, there was some way to manage all that on the server side. See, I got introduced to web programming via Cold Fusion. Session management on CF is exemplary. You simply say something likeIs there any easy way to achieve painless state management with perl and Apache? Obviously, I am not wanting to bop values around in the URL, and don't want to depend on cookies.So, uh, where do you propose to put the state information? Since HTTP is stateless, you'll need to put at least a session key in either the URL or a cookie, or submit it as a POST argument with every request (hint: DON'T do that), or something. Otherwise it's not possible.
<cflock timeout = "timeout in seconds "
scope = "Application" or "Server" or "Session"
name = "lockname"
throwOnTimeout = "Yes" or "No"
type = "readOnly/Exclusive ">
<cfset Session.foo = "Puneet">
<cfset Session.bar = "Kishor">
<cfset Session.baz = "punkish">
</cflock>
and bingo, my session (or app or server) vars are set. Then, when I want to use the vars, I just say
<cfoutput>Hi #Session.foo#, your username is #Session.baz#</cfoutput>
No session keys to pass around. Works really well.
Anyway, thanks for the info on Cache::Cache. I am off to learn more about state mgt with Perl and Apache.
Puneet.