php-phantomjs icon indicating copy to clipboard operation
php-phantomjs copied to clipboard

Cookie and php-phantomjs

Open DarthMoleman opened this issue 7 years ago • 8 comments

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

DarthMoleman avatar Oct 01 '16 14:10 DarthMoleman

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

cschalenborgh avatar Nov 14 '16 16:11 cschalenborgh

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

jonnnnyw avatar Nov 15 '16 10:11 jonnnnyw

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?

imam-zeropoint avatar Feb 19 '17 16:02 imam-zeropoint

@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.

andriuspetrauskis avatar Apr 10 '17 14:04 andriuspetrauskis

@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?

xelda1988 avatar Apr 11 '17 15:04 xelda1988

Did anyone ever fix this ?

cyberfab007 avatar Nov 05 '17 04:11 cyberfab007

Go go go go....

ahait avatar May 15 '18 11:05 ahait

Sadly...

godgod81302 avatar Aug 04 '20 06:08 godgod81302