Hi again! Had some more time to work on my W:M:F project. I installed the latest version today and it appears all my slowness/delay problems are fixed! Thanks for that! The whole thing runs way faster now and I don't have to ugly-hack the code.
My current problem is save_url isn't sending cookies with the GET request. I am get()ing a parent page then save_url a link to a large zip file in that page. The site *requires* cookies on all GETs, even for the zip, or it redirects to an error page.
I used wireshark to look at the traffic when I manually right-click and click save as in firefox vs. using W:M:F to save_url. Manually, the cookies get sent. save_url does *not* send the cookies (or referrer).
So I tried adding to the save_url code:
obj_Persist.persistFlags = obj_Persist.persistFlags | nsIWBP.PERSIST_FLAGS_FORCE_ALLOW_COOKIES;
after:
obj_Persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_FROM_CACHE;
As the mozilla docs seem to indicate that would do what I wanted. The cookies still do not get sent. I'm not sure why this doesn't work, unless the nsIWBP.PERSIST_FLAGS_FORCE_ALLOW_COOKIES option is broken. I checked and confirmed my Firefox/Gecko is new enough to support it, supposedly.
It makes sense to me that by default save_url should pass all cookies the site is expecting automatically, just as if you right-clicked and clicked save as manually.
Is there another approach I can take? Any ideas? I was thinking maybe pulling the cookies out and then passing them through manually into the obj_Persist.saveURI aExtraHeaders argument.
Thanks!
In reply to WWW::Mechanize::Firefox save_url doesn't send cookies by tcordes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |