1

I'm trying to figure out a way to transfer cookies from a Twill browser instance to a Zope browser instance. They both are built on Mechanize, so this should be possible.

I have tried:

zopeBrowser = zope.testbrowser.browser.Browser()
twillBrowser = twill.commands.get_browser()

twillBrowser.go("http://example.com/") # got some cookies
zopeBrowser.mech_browser._ua_handlers['_cookies'].cookiejar = \
    twillBrowser._browser._ua_handlers['_cookies'].cookiejar

But that doesn't seem to have worked.

Any ideas?

Thanks!

Tyler
  • 4,679
  • 12
  • 41
  • 60
  • If You wireshark it, is it really not sending cookies, or are You just denied because of UA change? – Almad Oct 10 '10 at 11:45
  • Have you introspected the respective cookie jars? Also, perhaps the twillBrowser and zopeBrowser mechanize state is using a different hostname (such as ip address verses hostname) to represent the same server and thus not match cookies the same way. – Martijn Pieters Jun 05 '11 at 09:04
  • You'll have to elaborate on "doesn't seem to have worked". – Ross Patterson Aug 12 '11 at 10:28

0 Answers0