How to get domains of same name cookies with different domain levels ?

30 views
Skip to first unread message

matkor

unread,
Oct 6, 2010, 7:47:06 AM10/6/10
to Pesto
Having set many cookies for different levels of given domain I receive
in COOKIE header many values for same cookie name like:

'HTTP_COOKIE': '$Version=1;
NAME=a; $Path="/"; $Domain=".some.domain.org";
NAME=b;

Unfortunately when I iterate over pesto_request.cookies:

for cookie_val in
pesto_request.cookies.getlist(cookie_key):
print "cookie_val(domain: %r): %s\n" %
(cookie_val.domain, cookie_val )

I am unable to find domain of received cookies as .domain is always
set to None.

Am I doing something wrong or this is feature/bug ?

I need to find cookie values for deepest domain level.

P.S. Big thanks for great toolkit !
Regards,

Oliver Cope

unread,
Oct 6, 2010, 9:43:27 AM10/6/10
to python...@googlegroups.com
On 06/10/2010 13:47, matkor wrote:
> Having set many cookies for different levels of given domain I receive
> in COOKIE header many values for same cookie name like:
>
> 'HTTP_COOKIE': '$Version=1;
> NAME=a; $Path="/"; $Domain=".some.domain.org";
> NAME=b;
>
> Unfortunately when I iterate over pesto_request.cookies:
>
> I am unable to find domain of received cookies as .domain is always
> set to None.
>
This looks like a bug to me - if the information's in the cookie header
then it should be available in the cookie object.

I'll look at fixing it and releasing an updated version as soon as I can.


Olly.

Reply all
Reply to author
Forward
0 new messages