When phantomjs is launched from node using the node-phantom bridge, cookies from node are not transferred properly. Does anyone know why?

Basically, I start using node and then run phantomjs. To take cookies from node to phantom, I code:

page.set('phantomcookies', nodecookiejar, callback);

But when I checked the cookies, there were so many phantomjs cookies than node cookies. Then I coded:

page.clearCookies(function(err){
    page.set('phantomcookies', nodecookiejar, callback);
}

The callback, obviously, is that the program is working in the correct order. But, I still have a few extra phantomjs cookies that I find really confusing since phantoms just have to copy cookies from node via node - phantom is a simple bridge (as far as I know). Any ideas will help. Thank.

+4

Source: https://habr.com/ru/post/1529894/


All Articles