[Tutor] I sure do love cookies.

Kent Johnson kent37 at tds.net
Wed Jul 6 01:21:37 CEST 2005

D. Hartley wrote:
> Thank you for the code, everyone.
> I actually have a piece of information (something like
> "this+is+a+cookie") that I am trying to *send* (not receive), and I'm
> not sure how to do it.  I looked at the Cookie examples a little bit,
> but am having trouble applying what I see there to my present
> situation, since there is so much that either a). doesnt apply or b).
> is over my head (usually c). all of the above!). Although the
> client-side illustration you provided was very clear and I'll archive
> that for future use, too.

Did you see the hint I posted a few days ago? I'll repeat it, if you want more detail then ask but after all it's supposed to be a challenge :-)

What I did was,
- create a new cookielib.Cookie
- add the cookie to the CookieJar
- make a request the same way as when I was collecting cookies

To create the new Cookie it might help to look at the source for cookielib (Lib\cookielib.py), the Cookie constructor doesn't seem to be documented anywhere.

To figure out the values for the Cookie constructor it might help to look at one of the cookies you already have.

I could be wrong but I don't think Cookie.SimpleCookie is going to get you there.


More information about the Tutor mailing list