5

Though document is not accessible from web worker can i access some how the cookie? unless i send a postMessage to main thread to give me cookie and it will send it via another postMessage

Fisherman
  • 5,949
  • 1
  • 29
  • 35

1 Answers1

8

No, you can access neither cookies nor localStorage ("local cookies").

Apart from using postMessage, you could also send a AJAX request to server to get/set a cookie. This is in no way more optimal of course - it will take way longer.

Community
  • 1
  • 1
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778