Perl: the Markov chain saw | |
PerlMonks |
Re: Is CGI::Session compatible with CGI::Lite::Request ?by afoken (Chancellor) |
on Apr 26, 2015 at 19:24 UTC ( [id://1124779]=note: print w/replies, xml ) | Need Help?? |
didn't work Details? The relevant part of your code, messages found in the error log? Documentation of CGI::Session says it is compatible with any CGI.pm like modules which have param() method. But CGI::Lite::Request do have param() method. Did you notice that load() in CGI::Session calls the cookie() method of $request (called $query in the CGI::Session source)? According to the documentation, cookie('somename') in CGI returns the cookie value (a string, a hash, or an array), but cookie('somename') in CGI::Lite::Request returns an instance of CGI::Lite::Cookie (an object). The current version of CGI::Session on CPAN also documents that the cookie() method is called, but it does not document what it is expected to return. The code seems to expect it to behave like CGI's cookie() method, i.e. return the value of the cookie, not a cookie object. Your options:
The helper class, quick and dirty and not tested:
Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|