Search code examples
c#asp.net-mvcsetcookie

Why google chrome does not write cookie with a special name?


I was testing some codes and write a cookie on my machine (MVC 5, .net 4.7), my test cookie name is "test".

After a while google chrome (Version 63.0.3239.84) did not write my cookie with the name "test" anymore but if I change the cookie name, it works fine as before.

I clear all the cookies but I can not write a cookie with this name: "test".

I clear chrome cookies files at:

C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\Default

But I still have the same problem.

My code:

HttpCookie cookie = new HttpCookie("test", "1");
cookie.Expires = DateTime.Now.AddHours(1);
Response.Cookies.Add(cookie);

Solution

  • From chrome v63 the cookies location was changed chrome://settings/siteData remove from here first then try.