How to secure the ASP.NET_SessionId cookie? 设置ASP.NET_SessionId Secure=true

How to secure the ASP.NET_SessionId cookie?

To add the ; secure suffix to the Set-Cookie http header I simply used the <httpCookies>element in the web.config:

<system.web>
  <httpCookies httpOnlyCookies="true" requireSSL="true" />
<system.web>

IMHO much more handy than writing code as in the article of Anubhav Goyal.

See: http://msdn.microsoft.com/en-us/library/ms228262(v=vs.100).aspx

原文地址:https://www.cnblogs.com/dupeng0811/p/how-to-secure-the-asp-net-sessionid-cookie.html