Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Philip M. Gollucci
Gokul P. Nair wrote: --- Philip M. Gollucci [EMAIL PROTECTED] wrote: Crap I missed the missing name. Didn't try expires. Its probably a bug. If you're interested in fixing it, you'll want to look at glue/perl/APR/Request/Cookie.xs I found the problem but I'm not sure where to implement the

Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Gokul P. Nair
the as_string() method being called by overloading is apparently not the same one as the Apache2::Cookie. The APR::Request::Cookie only returns the value not the full stringification. Thats right, it says this in the documentation in CPAN: The double-quote interpolation operator maps to

Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Gokul P. Nair
also printf Set-Cookie: %s\n, $cookie-as_string; displays the right values i.e. in my case Set-Cookie: foo=bar; path=/; expires=Sat, 02-Jul-2005 14:34:42 GMT Gokul P. Nair --- Philip M. Gollucci [EMAIL PROTECTED] wrote: Gokul P. Nair wrote: --- Philip M. Gollucci [EMAIL PROTECTED]

Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Philip M. Gollucci
Gokul P. Nair wrote: also printf Set-Cookie: %s\n, $cookie-as_string; displays the right values i.e. in my case Set-Cookie: foo=bar; path=/; expires=Sat, 02-Jul-2005 14:34:42 GMT I agree. http://p6m7g8.net/cookie is update to the below: Seems to work for me. sub handler () { my

Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Philip M. Gollucci
Gokul P. Nair wrote: the as_string() method being called by overloading is apparently not the same one as the Apache2::Cookie. The APR::Request::Cookie only returns the value not the full stringification. Thats right, it says this in the documentation in CPAN: The double-quote

Re: Apache2::Cookie confusing path and domain

2005-07-01 Thread Gokul P. Nair
$r-err_headers_out-add('Set-Cookie' = sprintf(%s, $cookie-as_string)); or the code below would suffice too. $r-headers_out-add('Set-Cookie'=$cookie-as_string); Gokul P. Nair --- Philip M. Gollucci [EMAIL PROTECTED] wrote: Gokul P. Nair wrote: also printf Set-Cookie: %s\n,

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
Hello, I read in the libapreq2 mail archives that using APR::* is recommended over the Apache2::Cookie modules and that there was debate over dumping the Apache2::* modules but were left behind only for backward compatibilities. Please check this thread:

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
Gokul P. Nair wrote: I'm confused as to which is the best way to go about setting and retrieving cookies. Any advice would be greatly appreciated. perldoc APR::Request::Cookie Its supposed to be available http://httpd.apache.org/APR/Request/Cookie.html but the doc generated had issues

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
Thanks for the attachment. What i still don't understand though is that when i create the cookie using APR::Request::Cookie-new(...) how do i bake it or in other words, how do i send it? I guess i can use the cookie_class() to set the class to Apache2::Cookie and then bake it, but again use of

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
Gokul P. Nair wrote: Thanks for the attachment. What i still don't understand though is that when i create the cookie using APR::Request::Cookie-new(...) how do i bake it or in other words, how do i send it? Am i even approaching this in the right direction? I'm hoping you missed this

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
Philip M. Gollucci wrote: I'd have to look the the $r-send_headers_xxx API my memory is failing me at the moment. use Apache2::RequestRec (); use APR::Table (); use APR::Request::Cookie (); my $cookie = APR::Request::Cookie-new($req, x); $r-err_headers_out-add('Set-Cookie' =

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Kevin A. McGrail
Hmmm, won't printing a response header directly when not in assbackwards mode and using $!++ cause also sorts of issues in Registry (or Perl Run)? KAM # print a response header printf Set-Cookie: %s\n, $cookie-as_string; I'd have to look the the $r-send_headers_xxx API my memory is failing

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
Kevin A. McGrail wrote: Hmmm, won't printing a response header directly when not in assbackwards mode and using $!++ cause also sorts of issues in Registry (or Perl Run)? KAM # print a response header printf Set-Cookie: %s\n, $cookie-as_string; I'd have to look the the

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
I'm hoping you missed this line: my $cookie = APR::Request::Cookie-new($req, name = foo, value = bar, domain = capricorn.com); Yes, I do have that

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Kevin A. McGrail
You know that after you set a cookie you cannot check for it's existence in the same session. Set a cookie. Reload. Then check for cookie existence. How are you checking that the cookie exists? One good way is to simply output the $ENV. foreach my $key (keys %ENV) { print $key -

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
As of now, to check to see if the cookie is set or not, i'm just doing something as simple as checking under 'Preferences' and 'View Cookies' in my browser's properties button. I've seen the cookies, that i set using Apache2::Cookie in the past, there. I don't see them now, reloading the page

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
I hope you mean $r-headers_out, if yes then i do have that line too, although it fails miserably. This is what i've got so far: my $req = $r-pool(); my $cookie = APR::Request::Cookie-new($req, name = foo, value = bar); $cookie-path('/'); $cookie-domain('192.168.1.155');

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
It works and i'm able to set the cookie, but the name and expires tags are not set in the cookie? Did it work for you? Is this a bug? Thanks. --- Philip M. Gollucci [EMAIL PROTECTED] wrote: I hope you mean $r-headers_out, if yes then i do have that line too, although it fails miserably.

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Philip M. Gollucci
Gokul P. Nair wrote: It works and i'm able to set the cookie, but the name and expires tags are not set in the cookie? Did it work for you? Crap I missed the missing name. Didn't try expires. Its probably a bug. If you're interested in fixing it, you'll want to look at

Re: Apache2::Cookie confusing path and domain

2005-06-30 Thread Gokul P. Nair
ok, I'll try and look at the code. Thanks Gokul P. Nair --- Philip M. Gollucci [EMAIL PROTECTED] wrote: Gokul P. Nair wrote: It works and i'm able to set the cookie, but the name and expires tags are not set in the cookie? Did it work for you? Crap I missed the missing name.

Apache2::Cookie confusing path and domain

2005-06-29 Thread Stephen Quinney
I'm having a problem with Apache2::Cookie (2.05-dev) and mod_perl2 (1.999.23). No matter what order I specify the parameters in for a new cookie the path always gets set to the value for the domain. Some sample code: my $cookie = Apache2::Cookie-new($r, -name

Re: Apache2::Cookie confusing path and domain

2005-06-29 Thread Chris Jacobson
Stephen, I have encountered this same problem (using 2.05-dev). The 'cheap-hack' workaround currently would be to do something like this: my $cookie = Apache2::Cookie-new($r, -name = $username, -value =

Re: Apache2::Cookie confusing path and domain

2005-06-29 Thread Philip M. Gollucci
Stephen Quinney wrote: I'm having a problem with Apache2::Cookie (2.05-dev) and mod_perl2 (1.999.23). No matter what order I specify the parameters in for a new cookie the path always gets set to the value for the domain. Some sample code: my $cookie = Apache2::Cookie-new($r,

Re: Apache2::Cookie confusing path and domain

2005-06-29 Thread Randy Kobes
On Wed, 29 Jun 2005, Stephen Quinney wrote: I'm having a problem with Apache2::Cookie (2.05-dev) and mod_perl2 (1.999.23). No matter what order I specify the parameters in for a new cookie the path always gets set to the value for the domain. [ .. ] This should be fixed in the current svn

Re: Apache2::Cookie confusing path and domain

2005-06-29 Thread Jonathan Vanasco
On Jun 29, 2005, at 2:04 PM, Chris Jacobson wrote: $cookie-path(/foo/); Changing my code to work in that fashion caused the 'domain' problem to go away. I know this is not a real solution, but it will avoid the bug until such time that it is fixed. If you don't upgrade to the