[PATCH] kcookiejar

Ralf Holzer ralf at well.com
Thu May 20 22:07:48 BST 2004


On Thursday 20 May 2004 04:38 pm, Waldo Bastian wrote:
> > But loadConfig() only sets the domain-specific
> > advice for the domain without the prepended dot.
>
> That depends on the configuration I would think.

You can try this with slashdot.org. Whatever you enter into the site-specific 
policy dialog (slashdot.org or .slashdot.org), kcookiejarrc always stores the 
domain without the leading dot.

> > This causes findCookie()
> > to skip over the cookie, because the advice is set to KCookieDunno (line
> > 348).
>
> ?? Why would it skip over the cookie when the advice is KCookieDunno? When
> the advice is KCookieDunno it will look at the next domain to see if that
> specifies a policy.

Because the actual domain in the cookie is stored as ".slashdot.org", but 
kcookiejarrc contains "slashdot.org". I added some debug output and saw that 
the ".slashdot.org" entry is set to 0 (KCookieDunno) and the "slashdot.org" 
entry 
to (1) KCookieAccept. But line 348 only sets the site policy, if it is 
something other 
than KCookieDunno. The next if statement then rejects the cookie for 
".slashdot.org"
, because the global policy is set to Reject (line 354).

> I'm not convinced that it is correct and if it is than there is probably a
> better way to do it.
>
> Can you post the relevant section of your kcookiejarrc file and say on
> which particular URLs you experience the problem you mention in BR80501?

My kcookiejarrc is attached. It doesn't matter which URL, but you can easily 
try it 
on slashdot.org. I have the global policy set to reject. Then I add a 
site-specific 
policy for "slashdot.org" and set it to Accept. The cookie never gets stored 
this way. 
So I switched the global policy to "Ask" in order to store the cookie. Once 
the cookie 
is stored, I switch back to "Reject".

The section that ends up in the cookies file contains the ".slashdot.org" 
domain:

[.slashdot.org]
slashdot.org         ".slashdot.org"      "/"          1116618385    0 user                 
4    deleted
slashdot.org         ""                   "/"          1116618385    0 user                 
4    deleted

greetings,
Ralf
-------------- next part --------------
[Cookie Policy]
AcceptSessionCookies=true
CookieDomainAdvice=slashdot.org:Accept
CookieGlobalAdvice=Ask
Cookies=true
IgnoreExpirationDate=false
RejectCrossDomainCookies=true


More information about the kfm-devel mailing list