Hi,
I've upgrade PhantomJs from 2.0 to 2.1.1 and now in this simple code:
for (var i = 0; i < options.cookies.length; i++) {
if (!phantom.addCookie({
'name': options.cookies[i].name,
/* required property */
'value': options.cookies[i].value,
/* required property */
'domain': options.cookies[i].domain /* required property */
})) {
errMsg = "Error setting. Unable to set cookie value.";
sendWarningMessage(errMsg);
if (debugMode) console.log(errMsg);
//phantom.exit( 104 ); // ERROR -4
}
}
addCookie always returns false, also if cookies are correctly added.
Infact removing this part of code, the page is redirect to login page cause of missing cookies.
Any ideas?
Thanks a lot for filing this issue! We'll triage and take a look at it as soon as possible!
I compiled and tested #14068 on ubuntu and it fixes my problems of not being able to set session values. Thanks!
@Vitallium When is this fix landing in a release? I depend on the phantomjs-prebuilt npm package which is not able to get this patch unless it's an official release.
@Vitallium @bgever The same here. We need this fix because we need to set cookies in our cucumber web test cases. Currently I'm setting up an environment to be able to build an own version based on the latest master branch.
This fix will be available in the next version.
@Vitallium Thanks for your update. When we can expect the new version?
I built phantomjs from master
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout master
git submodule init
git submodule update
Still unable to set Cookie via Codeception.
Got a build error when checking out d038837
@Vitallium Same issue here - I see that 2.2.0 milestone is 5 months late and has 10 issues still open, is it fair to say that this fix wont be made available through a point -release release anytime soon?
Thanks :)
Any update on this? With the update to macOS Sierra, 1.x and 2.0.x don't work due to segfault, and 2.1 has this cookie issue, which means no working version.
How hard is it to create a 2.1.2 release with just this bugfix?
actually you can't build phantomjs from source ;( https://github.com/ariya/phantomjs/issues/14585
When will this be released?
This fixed our issue. I've built a 64 bit phantomjs 2.1.1 with d0388371cfda166d97165c1b68182857b954cc83 cherry-picked using the instructions in the deploy directory, if someone needs it, the binary is here: https://github.com/nkovacs/selenium-standalone-phantomjs/tree/62f2a2a56ddbce1c13218aabe60f516afdeffdd8
I applaud the work - thank you. Running with your binary it seems that my cookies aren't actually applied to the browser session. In working with a logged in session where state is maintained by the cookies; the website will not recognize the cookies applied to a new browser session - IE: requires loggin even though my session cookies are valid. Haven't looked at your code to see what is going on there but it seems that not all my cookies are getting attached back with add_cookie. I can however, take the same cookies and slam them into chrome with add_cookie and the website doesn't request a new login.
Can you make 2.1.2 with this fix?
@ariya @Vitallium
Please make a release with this fix
@ariya @Vitallium
Just wanted to follow up to see if there was a plan to make a release soon. Thank you for all your effort!
Hey there, is there likely to be a 2.1.2 with this fix? Many thanks!
I have this fork with d038837 cherry-picked on 2.1.1: https://github.com/ryllari/phantomjs
The fix is in tag 2.1.2. (https://github.com/Ryllari/phantomjs/tree/2.1.2)
If you get impatient waiting for a release, try using Chrome headless instead, with chromedriver
I am still running version 2.0.0, because it works well for me.
I did have a problem on Sierra (funnily enough, only on a new Macbook Pro; my 2011 Macbook Pro, although upgraded to Sierra, was fine). I got the message Killed: 9. I read on Stack Overflow that this can be caused by an improper Mach-O header or some such thing in upx-compressed executables. So I installed upx (I use MacPorts, so I did sudo port install upx and I got version 3.94). I then ran upx -d phantomjs and then upx phantomjs and lo and behold, it worked! So I am still happily running phantomjs 2.0.0.
Thought this might help someone.
Most helpful comment
How hard is it to create a 2.1.2 release with just this bugfix?