Phantomjs dont send cookies in request header

371 views
Skip to first unread message

Измеров Дмитрий

unread,
Apr 13, 2015, 10:02:48 AM4/13/15
to phan...@googlegroups.com
Hello, I try to write script with phantomjs, that login in site and then do some actions with account of registered user and when I try to do actions - it is crashed because 
phantomjs dont send cookies in request headers to server. I tried to use --cookies-path=/some/path params and to add cookies to header by hand through page.onResourceRequested or page.customHeaders but all are failed. 
Usual normal browser persist session cookies and use them in requests of page or resources. And what must I do so that phantomjs to send cookies that can change in process of script work?

Christian Gillot

unread,
Apr 14, 2015, 9:08:49 AM4/14/15
to phan...@googlegroups.com
Hello,

    This is strange because PhantomJS do send cookies with the headers. Which version are you using?
Did you try to compile it yourself?

Измеров Дмитрий

unread,
Apr 17, 2015, 3:09:37 AM4/17/15
to phan...@googlegroups.com
I use version 2.0.0 for linux, my OS - Ubuntu 14.04. I print request and didnt see any true cookie headers in log info after execution script - used this 

page.onResourceRequested = function(requestData, networkRequest) {
 console
.log('Request (#' + requestData.id + '): ' + JSON.stringify(requestData));
};

I didnt try to compile for self. I will try your advice, thanks.
понедельник, 13 апреля 2015 г., 17:02:48 UTC+3 пользователь Измеров Дмитрий написал:
Reply all
Reply to author
Forward
0 new messages