perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John ORourke <john-modp...@o-rourke.org>
Subject Re: reset multiple cookies
Date Sun, 10 Dec 2006 08:51:18 GMT
Very strange then... My best guess is the browser will only accept one 
cookie with a given name in a given set of headers - check the response 
headers to see that they're all there, then you know it's the browser.  
I found the Web Developers Toolbar for Firefox very useful when doing my 
cookie code - you can view, manually add, clear session cookies, clear 
domain cookies, view which cookies will be sent to the server, view 
response headers etc.

Marc Lambrichs wrote:
> That's exactly what I'm trying to do now. But, like I said, only the 
> last one is changed/set.
>
> Marc
>
> John ORourke wrote:
>
>> Marc Lambrichs wrote:
>>
>>> I'm trying to reset multiple cookies. However, only the last one of 
>>> the @cookies array is reset. How come?
>>>
>>>        foreach ( @domains ){
>>>                                                    ( domain => $_ ),
>>>        foreach my $cookie ( @cookies ){
>>>            $r->err_headers_out->add( 'Set-Cookie' => 
>>> $cookie->as_string );
>>>        }
>>
>>
>> This would only work if all the domains have an ending containing 2 
>> dots matching the host setting it - eg. www.yoursite.com can set 
>> cookies for something.yoursite.com and another.yoursite.com, but not 
>> for www.microsoft.com.  Imagine if your favourite warez site set a 
>> cookie with domain microsoft.com...
>>
>> Of course, this rule was invented by short-sighted inhabitants of 
>> .com/net/org, so when .co.uk came along it became a bit worthless but 
>> nobody's ever decided to fix it.
>>
>> http://blog.javido.net/index.php?tag=cookies
>>
>> cheers
>> John
>>
>
>


Mime
View raw message