I have written a chrome extension which adds some cookie to domain in which my web app is running.

The API chrome.cookie.set() works for all domains except when I use the domain as "localhost". If I try to access the web app running locally using the domain "127.0.0.1" or "0.0.0.0" the API "chrome.cookies.set()" works as expected.

This does not work only when I use the domain as "localhost". How Can I fix this issue for "localhost" domain?

有帮助吗?

解决方案

Try cookie Domain = null or set the cookie to " " for localhost.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top