Phantomjs不应该发送cookie

时间:2016-07-29 19:06:55

标签: node.js express cookies phantomjs

我正在使用phantomjs,特别是phantom-prebuilt中的npm来查看我的节点快递应用程序正在发送的页面,但它不会发送cookie,尽管它们位于同一个域中。

如何让幻像正确发送cookie?

var system = require('system');
var page = require('webpage').create();

phantom.addCookie({
    domain: 'domain',
    name: 'ru.sid',
    value: 'aValue'
});

console.log(JSON.stringify(phantom.cookies[0]);
/* This is what is logged
{
    domain: '.domain',
    httponly: false,
    name: 'ru.sid',
    path: '/',
    secure: false,
    value: 'aValue'
}
*/

page.open('domain/anotherPath') //cookie is not sent

0 个答案:

没有答案