How can I set the Secure flag on an ASP.NET Session Cookie?

前端 未结 5 1242
萌比男神i
萌比男神i 2020-11-28 20:30

How can I set the Secure flag on an ASP.NET Session Cookie, so that it will only be transmitted over HTTPS and never over plain HTTP?

5条回答
  •  有刺的猬
    2020-11-28 20:58

    secure - This attribute tells the browser to only send the cookie if the request is being sent over a secure channel such as HTTPS. This will help protect the cookie from being passed over unencrypted requests. If the application can be accessed over both HTTP and HTTPS, then there is the potential that the cookie can be sent in clear text.

提交回复
热议问题