Why serviceworker cannot access cookies

As I know, Worker Services cannot access cookies. Because of this, I encountered a lot of problems when implementing SW for my site.

I want to know what are the reasons that Service Workers cannot access cookies. Now I use messaging to send the contents of the cookie to Service Workers . Is there a better way or hack it more efficiently?

+5
source share
1 answer

There is no reason. Some use cases have been proposed, and a new API is under development. Be sure your use case and ideas are useful in the conversation, if they are not already covered.

You can use postMessage() client to request cookies and send it to a service employee.

+7
source

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


All Articles