Michael wrote:
Problem:I have upgraded an application to use CGI::Application::Plugin::Apache which, if you haven't seen changes you app to use Apache::* modules instead of CGI.pm. I also wanted to use the CGI::Application::Plugin::Session module as well since it's easy to use and clean. But it uses the CGI.pm cookie() method to generate the cookie to glean the session id and to create a new cookie for the headers.
Funny that you report this yourself, as I was wondering about that too, and going to ask you before adopting your module. It looks very interesting to me, but I waited a bit to find out how to handle exactly this case. And it looks to me it doesn't, as yet.
Now CAP::Apache does a lot to make sure it can handle headers generated like this but the query object (since it's an Apache::Request object) doesn't have a cookie() method.A proposed solution would be to modify CAP::Session to either check the type of object that $query is and only use the cookie() method if it's CGI.pm, else use CGI::Cookie since that's what CGI uses under the hood anyway) or it could even check to see if the $ENV{MOD_PERL} is set and if it is, use Apache::Cookie, else use CGI::Cookie.
I noticed in the CAPS source that it pulls out the SID maually if not supplied with a CGI object (which looks careful and appropriate to me), but happily uses $self->query->cookie elsewhere.
Either way should work and it would even help those who use other non CGI.pm query objects (like CGI::Simple, etc)
I have the feeling that this check doesn't really belong in CAPS, since it could be useful elsewhere too. It would be a waste if we had to do the same checks in several places, IMHO.
Thoughts ?
Should we write a CAP::Cookie for this? Something that adds cookie
handling to CgiApp?
I don't suppose it's feasible to make changes to Apache::Request or
Apache::Cookie, even though it might help their adoption if they were
api compatible with CGI.
Rhesa Rozendaal
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.