Skip Menu |
 

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 6141
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: MARKSTOS [...] cpan.org
Requestors: ron [...] savage.net.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.94
Fixed in: (no value)



Subject: isa('CGI') should be can('cookie') and can('param')
Download (untitled) / with headers
text/plain 293b
Line 168 of Session.pm is: if ( $arg->isa('CGI') ) { This stops CGI::Simple being used as a replacement for CGI, eg in apps using CGI::Application and CGI::Session. By using if ($arg -> can('cookie') )... elsif ($arg -> can('param') )... CGI and CGI::Simple, and other classes, could be used.
From: markstos [...] cpan.org
Download (untitled) / with headers
text/plain 511b
[guest - Mon Apr 26 20:58:17 2004]: Show quoted text
> Line 168 of Session.pm is: > if ( $arg->isa('CGI') ) { > This stops CGI::Simple being used as a replacement for CGI, eg in
apps Show quoted text
> using CGI::Application and CGI::Session. > By using if ($arg -> can('cookie') )... elsif ($arg ->
can('param') )... Show quoted text
> CGI and CGI::Simple, and other classes, could be used.
This has been resolved in the 4.x series. The attached patch confirms the support of it with a test script. This bug can be resolved now. Mark
Download cgi_simple.patch
text/x-diff 1.4k
Sun Jul 3 23:19:20 EST 2005 Mark Stosberg <mark@summersault.com> * RT#6141: confirm that CGI::Simple is supported diff -rN -u old-cgi-session/Changes new-cgi-session/Changes --- old-cgi-session/Changes 2005-07-03 23:20:18.000000000 -0500 +++ new-cgi-session/Changes 2005-07-03 23:19:06.000000000 -0500 @@ -2,6 +2,7 @@ ===================================================================== * FIX: Added back is_new() for compatibility with 3.95. (Mark Stosberg) + * FIX: Support for CGI::Simple is confirmed, resolving RT#6141 (Mark Stosberg) 4.00_08 - Tuesday, March 15, 2005 diff -rN -u old-cgi-session/t/cgi_simple.t new-cgi-session/t/cgi_simple.t --- old-cgi-session/t/cgi_simple.t 1969-12-31 19:00:00.000000000 -0500 +++ new-cgi-session/t/cgi_simple.t 2005-07-03 23:18:03.000000000 -0500 @@ -0,0 +1,21 @@ +# Test CGI::Simple support in CGI::Session +use Test::More; + +if ( eval { require CGI::Simple; } ) { + plan qw/no_plan/; +} +else { + plan skip_all => 'CGI::Simple not installed, so skipping related tests.'; +} + +use CGI::Session; +my $q = CGI::Simple->new('sid=bob'); +my $s; +eval { $s = CGI::Session->new(undef,$q); }; +is($@,'', "survives eval"); + +ok( $s->id(), 'CGI::Simple object is accepted when passed to new()' ); + +like( $s->cookie(), qr/CGISES/i, "cookie() method works with CGI::Simple"); +like( $s->http_header(), qr/Content-Type/i, "http_header() method works with CGI::Simple"); +


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.