Reetesh,
I also looked over your urllib2 example. It seems like it should work.

When I have to deal with a login which handles the session through a
cookie, I will just install the opener globally to make it easier to deal
with. After I run urllib2.install_opener(opener), I can simply call
urllib2.urlopen() without worrying about setting up the cookies or
interfacing with the opener that was built.

For us, it would be helpful to know why you are inspecting cookies? What's
the end goal? There may well be a different solution than dealing with the
specific cookie problem.

For you, it might be helpful to understand exactly what cookies are (
http://en.wikipedia.org/wiki/HTTP_cookie). To paraphrase, the server will
send a cookie key/value pair back to the client. From then on the client is
expected to send that cookie back to the server as part of each request.
This is exactly why the opener is necessary. It will handle the persistent
client information.

I just dug up a recent script that I am using urllib2 with. It's a one-off
script that I hashed out without much care, but I think it's legible.
http://pastebin.com/VFuAqFB9

For those that don't want to read the source, it's a downloader for VRay
nightlies. My studio has been doing some serious testing of the GPU
rendering, and we always want the latest build available.

Cheers,
jesse

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CANESWi2RCnx4TD3s9W0W4DKuGt6jLt%2BzCsPq0oGmaZ_kKXZoXg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to