Session Cookie Secure in ASP.NET MVC

187 views Asked by At

I have a situation where there is no ASP.NET_SessionId cookie in the response at Application_EndRequest(), but when I inspect and in the network tab I could see ASP.NET_SessionId and its not secured. Please see below image for reference:

enter image description here

I have added the <httpCookies requireSSL="true"/> in the web.config and also set the response cookie secure flag as true in the Application_EndRequest() method.

I am not getting this issue every time, And for the first time the cookie is secured because ASP.NET_SessionId cookie exists in the response at Application_EndRequest() method and I am setting the secure flag as true, but the second time the response cookie is empty but the network tab has it as shown in the above image.

Is it some kind of Chrome issue or should I have to fix it. Please guide me.

0

There are 0 answers