1

I know that document.cookie does not return metadata such as path or domain in javascript. However, is it possible to access the path and domain of cookies in TestCafe? I have done searching on the GitHub repo as well as stack overflow, but all I have found is ClientFunction which still uses document.cookie.

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
noahpc
  • 366
  • 5
  • 13
  • 2
    There are no specific APIs in TestCafe, which you can use to manipulate cookies. The client function is the only way to do this. Refer to the following thread for more information: https://stackoverflow.com/questions/2959010/how-to-get-the-domain-value-for-a-cookie-in-javascript – aleks-pro Oct 11 '19 at 11:19
  • @aleks-pro - Sad day. I have already read through the linked stack overflow. I was hoping that there was a way in TestCafe - because hammerhead intercepts the cookies, so it definitely knows the domain, path, etc. It actually stores them like s|58fWWs3h4|_cookie1|testserver.com|%2F|kbzkc340|k19rpp2b=41bbe664c37c7417c305fc1458547d60;path=/ so it seems like the framework itself has the cookie info somewhere – noahpc Oct 11 '19 at 16:11

0 Answers0