Hi Jonathan,

You wrote:

> Strange. I'm doing nearly exactly the same upgrading Dan is doing
> and using CGI::Simple and CGI::Session thusly:
> 
> [snip]
> use CGI::Session;
> [snip]
> sub cgiapp_get_query {
>    my $self = shift;
>    require CGI::Simple;
>    my $query = CGI::Simple->new();
>    return $query;
< }

That's exactly what I was doing. Note I had switched to
CGI::Application::Plugin::Session, but I belive the principle is the same.
However, with CGI::Simple, I needed to set the Session ID explicitly to get
things to work, rather than use the CGI query:

    my $sid = $query->cookie('CGISESSID') || undef;
 
    # Configure the session
    $self->session_config(
        CGI_SESSION_OPTIONS =>
            [ "driver:File", $sid, { Directory => 'c:/temp' } ],
        COOKIE_PARAMS => { -expires => '+1h', },
        SEND_COOKIE   => 1,
    );

The advantage of the plugin is that

A) When using CGI.pm, none of the code above is required (unless the
defaults need to be changed - I use Windows for development, so my temp
directory is explicitly set).
B) It's lazy loading

ASIDE: Cees, what's your feeling about using a different default directory
depending on the OS?

Dan

-----Original Message-----
From: Jonathan Mangin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 19 October 2004 2:32 a.m.
To: Cees Hek
Cc: [EMAIL PROTECTED]
Subject: Re: [cgiapp] CGI::Application::Plugin::Session - new session every
call



----- Original Message ----- 
From: "Cees Hek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 18, 2004 2:50 AM
Subject: Re: [cgiapp] CGI::Application::Plugin::Session - new session every 
call


> On Mon, 18 Oct 2004 20:18:17 +1300, Dan Horne 
> <[EMAIL PROTECTED]>
> wrote:
>> Cees Hek wrote:
>> > Is it possible that you are using CGI::Simple instead of CGI?
>>
>> Ah, that's it! I thought CGI::Simple was a drop-in replacement for 
>> CGI if
>> I
>> didn't require the HTML functions (as per
>> http://twiki.med.yale.edu/twiki2/bin/view/CGIapp/TipCGISimple).
>
> This is not the fault of CGI::Simple, but of CGI::Session. 
> CGI::Session will only work if you pass it a real CGI.pm object (it 
> does an ->isa('CGI') call on the object passed in).  What it really 
> should do instead is check for the existence of a 'cookie' and 'param' 
> method.  It might be worth sending the author of CGI::Session a patch 
> to fix this.
>
> I ran into this with a few other modules as well, hence I abandoned 
> using CGI::Simple.  It is unfortunate, because CGI.pm has so much 
> stuff in it that I never use...
>
> Cheers,
>
> --
> Cees Hek
>

Strange. I'm doing nearly exactly the same upgrading Dan is doing
and using CGI::Simple and CGI::Session thusly:

[snip]
use CGI::Session;
[snip]
sub cgiapp_get_query {
   my $self = shift;
   require CGI::Simple;
   my $query = CGI::Simple->new();
   return $query;
}

I haven't exercised it enough but seems to be working fine.
Is it possible CGI.pm is being loaded and used somehow? How
can one tell? I did just upgrade with CPAN all modules on 5.8.2.

--Jon



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to