title: Cookie SameSite property works on localhost but not after publishing to server
body: <p>I've used ASP MVC with .NET 4.7.2 to set the cookie on server side with the following code:</p>
  <pre><code>            ClientCookie = new HttpCookie(&quot;SuperCookie&quot;);
              ClientCookie.Value = dbNewCustomerCookie.CustomerCookieID.ToString(); // new inserted DB value
              ClientCookie.Expires = DateTime.Now.AddYears(2);
              ClientCookie.HttpOnly = true;
              ClientCookie.Secure = true;
              ClientCookie.Shareable = true;
              ClientCookie.SameSite = SameSiteMode.None;
              Response.SetCookie(ClientCookie);
              Response.Flush();
  </code></pre>
  <p>While on localhost this is working fine and SameSite is set to None, after pushing this to server the SameSite flag come unset after every request. Localhost and server version are both running over HTTPS. Checked .NET version on server, have deleted the cookie to be recreated, tried with different web.config settings on server, also tried with URL rewrite module, but nothing worked.</p>
  <p><a href="https://i.stack.imgur.com/ZqQ9S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZqQ9S.png" alt="enter image description here" /></a></p>
  <p>Could this be a code issue or server/host issue ? We are using Amazon (private servers with access to IIS) to host our websites.</p>
  <p>UPDATE : running the site on server localhost keeps returning SameSite as empty, while development machine returns always SameSite set as None. Both machines have .NET 4.7.2 installed, are running with the same web.config over IIS 7.</p>
  <p>UPDATE 2 :  if I set ClientCookie.SameSite = SameSiteMode.Lax then it will also work for server requests; but won't work to set the mode to SameSiteMode.None. With Lax mode the cookie is not created for cross-site requests, which is required because I call the website from an iframe.</p>
  <p>UPDATE 3 : I think the reason of this is that the server is not updated with the latest functionality that support the samesite as none : <a href="https://docs.microsoft.com/en-us/aspnet/samesite/kbs-samesite" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/samesite/kbs-samesite</a>, since the company will not update the server (internal policy) I will try to set the cookie from client side</p>