JSON.stringify() saving in cookies but error 403

I am trying to save or set this below value in $.cookie() // jQuery as I set and reloaded the page, but the error showed error 403.

again when I delete the cookies, the page opens rightly.


How did I set it properly and without error?

Your json string looks correct. So it should be possible to store it in a cookie. Also storing in a cookie should not cause an error at all. So there must be something in your code which is wrong but you need to show it to us.

Btw. The string is much more readable if you put it in single quotes

Are you trying to use this cookie for authentication? 403 means the server denied access to the remote resource.

in cookies, it shows like this

I think this error comes from my “serviceworker.js” file pastebin

(event.request.method === "GET" && event.request.headers.get("accept").includes("text/html"))

Please help How I fix this…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.