我正在使用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