Reputation: 1040
Since last updating Chrome (version 84.0.4147.125) some cookies aren't getting set whilst others are.
On searching around, many people have had this issue since Windows 2004 update. This is not the case here, as Windows is still on version 1909.
The .AspNet.Consent cookie gets set with local host but not with the live site. AspNetCore.AntiForgery always gets set. When trying to set my own basketId cookie, it doesn't work even when setting 'IsEssential = true'.
CookieOptions co = new CookieOptions {
SameSite = SameSiteMode.None,
Secure = true,
IsEssential = true,
Expires = new DateTimeOffset(2028, 1, 1, 0, 0, 0, TimeSpan.FromHours(0))
};
Response.Cookies.Append("BasketId", basket.ID.ToString(), co);
This issue does not occur in other browsers. I have tested in Edge and Firefox and the issue is not present.
Upvotes: 1
Views: 609
Reputation: 9460
Obviously depends on the use case, but I would guess a basket cookie is essential to the site, so you can set IsEssential
to true, which overrides the user consent.
This may not work for everything, but should get you out of this current problem.
Upvotes: 1