Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't serviceworker access cookies

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?

like image 436
biswpo Avatar asked Feb 29 '16 06:02

biswpo


1 Answers

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.

like image 181
Salva Avatar answered Dec 27 '22 22:12

Salva