----- Original Message -----
From: "will trillich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 7:09 AM
Subject: Re: CGI::Cookie vs Apache::Cookie -- help?


> On Sun, Jun 17, 2001 at 11:14:23PM -0400, Chris Winters wrote:
> > * will trillich ([EMAIL PROTECTED]) [010617 23:04]:
> > > $r->log_error( qq(...id=$ID, sending cookie) );
>
> --this outputs the string i'm hoping for, into the log file.

That's because you're outputting $ID and not the cookie itself, which you're
creating below.

>
> > > my $cookie =
> > > Apache::Cookie->new( $r,
> > > -name   => $cookie_name,
> > > -value  => $ID         ,
> > > -domain => $r->hostname,
> > > -path   => '/'         ,
> > > );
> > > $r->header_out('Set-Cookie', => $cookie);
>
> > From 'perldoc Apache::Cookie'
> >
> >    bake
> >        Put cookie in the oven to bake.  (Add a Set-Cookie
> >        header to the outgoing headers table.)
> >
> >            $cookie->bake;
>
> what does $cookie->bake do (add set-cookie header) that
> $r->header_out('set-cookie'=>$cookie) (add set-cookie header)
> does not?
>
> [ and why ain't that mentioned in the manual? ]

As someone else stated, bake() actually sends a Set-Cookie header, but with
$cookie->as_string and not just $cookie (which is an instance of
Apache::Cookie). When you're just sending $cookie you're sending an object
reference.

Per Einar Ellefsen
[EMAIL PROTECTED]

Reply via email to