Setting Cookie Secure Flag – ASP.NET
Method #1 Setting Secure Property True
Create Cookie by setting secure property true:
HttpCookie cookie = new HttpCookie('name'); cookie.Secure = True; cookie.Value = 'Value';
Method#2 Using web.config
Add the following codes to web.config
<system.web> <httpCookies requireSSL="true" /> </system.web>
Leave a Reply
Want to join the discussion?Feel free to contribute!