1

I have an ApiController in which I set a tokenId as cookie using this code:

var cookie = new HttpCookie("TokenId", tokenId)
                         {
                             Expires = DateTime.Now.AddDays(1),
                             Domain = this.Request.RequestUri.Host,
                             Path = "/"
                         };

HttpContext.Current.Response.SetCookie(cookie);

Using Firefox it's working and firebug shows the received cookie. But Chrome doesn't show the cookie in the debugger. And on the further HttpRequests it doesn't send the cookie

mehrandvd
  • 8,806
  • 12
  • 64
  • 111
  • possible duplicate of [Chrome doesn't create cookie for domain=localhost in broken https](http://stackoverflow.com/questions/8134384/chrome-doesnt-create-cookie-for-domain-localhost-in-broken-https) – Erik Philips Dec 15 '13 at 04:26

1 Answers1

2

It seems Chrome can not store cookies with domain localhost. So while developing a website you can't store cookies!

I've found out this problem via another SO question:

This problem is also addressed at here which caused some developers to leave chrome and migrate to Firefox!

Community
  • 1
  • 1
mehrandvd
  • 8,806
  • 12
  • 64
  • 111