jonnnnyw / php-phantomjs

Execute PhantomJS commands through PHP
MIT License
1.44k stars 432 forks source link

Cookie and php-phantomjs #124

Open DarthMoleman opened 8 years ago

DarthMoleman commented 8 years ago

Hi,

I have a file named predefinedcookie.txt that I already use for a list of websites compatible with curl. I would like to know how can I use it with php-phantomjs or what do I have to do to push cookie's variable in my request.

Best regards. Luc

cschalenborgh commented 7 years ago

Any updates on this? We've got a use-case for this library but only if it can work with predefined cookies.

jonnnnyw commented 7 years ago

I will be working on v4.6 over the next few days so I will try and get cookie management in there.

imam-zeropoint commented 7 years ago

Session cookies are still missing and do not appear in the predefined cookie file. Also pushing cookies via $request->addHeader and addCookie do not appear in the response (Set-Cookie) hence missing flow among different requests.

But definitely request object shows some cookie is going to add via addCookie:

[cookies:protected] => Array ( [add] => Array ( [0] => Array ( [name] => JSESSIONID [value] => JSESSIONID_VALUE [path] => / [domain] => testdomain.com [httponly] => [secure] => 1 [expires] => 1487525134 )

            )

        [delete] => Array
            (
            )

    )

But nothing appears regarding forced cookies, neither in the response nor in predefined cookie file, what is the failure here?

andriuspetrauskis commented 7 years ago

@imam-zeropoint Session cookies are not stored in cookie file, according to this issue. @jonnnnyw, I have made a pull request #172 which adds ability to get cookies programmatically from response, without using --cookies-file flag.

xelda1988 commented 7 years ago

@stexaz

I also need cookies to pass between requests. I just checked out your code - looks like a nice job :)! But as I use the package via packagist I want to wait until the pull request is through.

@jonnnnyw Will the pull request go through anytime soon?

cyberfab007 commented 7 years ago

Did anyone ever fix this ?

ahait commented 6 years ago

Go go go go....

godgod81302 commented 4 years ago

Sadly...