Page 1 of 1

Sending cookies with URL requests

PostPosted: Mon May 14, 2012 3:11 am
by insane822
Hello,

Are there any plugins that I can take a look at on how to send cookies with url requests?

I'm coming from python:
  Code:
self.cj = CookieJar()
#Setup URL handler
self.login = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj),urllib2.HTTPSHandler)

#Define my cookies
self.auth_cookie = "foobar"
self.session_cookie = "foobar3000"

#Append my cookies
self.login.addheaders.append(('Cookie', "auth=%s;session=%s" % (self.auth_cookie, self.session_cookie)))

#All subsequent requests will send the cookies
print self.login.open("http://www.example.com/video/12342/xml").read()
print self.login.open("http://www.example.com/video/323448745/xml").read()


Can anyone point me to a plugin that uses cookies? I've searched online, but none of the methods listed seem to be available.


Thanks!! :)

Re: Sending cookies with URL requests

PostPosted: Mon May 14, 2012 7:09 am
by will

Re: Sending cookies with URL requests

PostPosted: Mon May 14, 2012 10:04 am
by zip
if you just want it for GET requests look at the guide, Shared methods, openUrl()

Re: Sending cookies with URL requests

PostPosted: Mon May 14, 2012 12:25 pm
by insane822
Thanks to both of you. I looked at the guide last night, but I'll get myself some new glasses.. that helps a ton!

Thank you :D