8

As per as i know Service Workers can not access the cookies. Because of this i am facing a lot of problems in implementing SW for my site.

I want to know what are the reasons, that Service Workers can not access the cookies.Right now I am using messaging to convey the cookie content to Service Workers. Is there any better way or hack to do it more efficiently?

biswpo
  • 771
  • 7
  • 23
  • Possible duplicate of [Read cookies from within a Service Worker?](http://stackoverflow.com/questions/35447567/read-cookies-from-within-a-service-worker) – Marco Castelluccio Feb 29 '16 at 15:22

1 Answers1

8

There is no reason. Some use cases have been proposed and a new API is under development. Sure your use case and insights are useful in the conversation if they are not covered yet.

You could use postMessage() to a client to request the cookies and send it to the service worker.

Salva
  • 6,507
  • 1
  • 26
  • 25