1

I'm running some Qunit tests to test a framework. I'm not able to fetch the cookies from phantomJS as my test hangs there. It's not able to read cookies.

I tried to fetch the fetch phantom cookies with phantom.cookies function, yet chutzpah doesn't execute those statements ? is there way for me to fetch phantom cookies with chutzpah ?

1 Answers1

0

document.cookies should work as long as you are not violating the same-origin policy. This gets tricky when you are running with local files sometimes since the origin of file system files is odd. I pass into Phantom the argument to ignore allow cross domain loading but I wonder if that doesn't apply to cookies.

Couple things

  1. Can you give me a sample zip which repros your problem?
  2. You might want to file a bug on PhantomJS which says document.cookies should return from other domains if you set

page.settings.webSecurityEnabled = false;

Thanks!

Matthew Manela
  • 16,572
  • 3
  • 64
  • 66