Kam
Kam

Reputation: 11

Not able to see cookie, Chrome and local path

I am creating cookie in one fresh .Net application and it doesn't have any code other than cookie creation, following are my code.

private void SaveCookie() {

HttpCookie cookie = new HttpCookie("CookieTestTestCookie1") { Value = "Test1", Domain = "local", HttpOnly = false, Expires = DateTime.Now.AddDays(5) };

this.Response.Cookies.Add(cookie); this.Response.SetCookie(cookie);

}

This cookie I am not seeing it in both the places.

1.Google Chrome -> F12 -> Application tab -> Cookie

2.C:\Users\username\AppData\Local\Microsoft\Windows\Cookies....

Please advice where I am doing wrong...

Upvotes: 0

Views: 173

Answers (1)

Boney
Boney

Reputation: 2202

Change Domain = "local" to Domain = "localhost"

Upvotes: 2

Related Questions