I have developed a Chrome extention that modifies web pages for an ASP.net system used at my workplace.
Due to the new Cookie restrictions introduced in recent versions of Chrome, I have to remove the SameSite lax cookie and replace it with a SameSite none, secure cookie.
The organisation has recently updated Chrome from 75 to 80. Now it works for some people and is broken for others.
When attempting to use Chrome.cookies api, the error is Unchecked runtime.lastError: Failed to parse or set cookie named "ASP.NET_SessionId".
Everybody appears to be running the same version of Chrome, and the cookie key is always the same.
See below for code. I have replaced the urls for this example.
function sameSiteCookieMaker() {
chrome.cookies.get({
"url": "https://example.example.example.com.au",
"name": "ASP.NET_SessionId"
}, function(cookie) {
state = cookie.value
chrome.cookies.remove({
"url": "https://example.example.example.com.au",
"name": "ASP.NET_SessionId"
}, function(cookie2) {
chrome.cookies.set({
"url": "https://example.example.example.com.au",
"domain": "example.example.example.com.au",
"httpOnly": true,
"name": "ASP.NET_SessionId",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"storeId": "0",
"value": state
})
})
})
}