[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
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");
+