Ours is a .Net core 2.2
web service application.
We use Checkmarx
SAST
to scan our source code.
It is giving us recommmendations such as HttpOnlyCookies
and Insecure_Cookie
.
these recommendations target the Startup class in Startup.cs file.
The below lines will get rid of these recommendations
In ConfigureServices function:
services.Configure<CookiePolicyOptions>(options =>
{
options.HttpOnly = HttpOnlyPolicy.Always;
options.Secure = CookieSecurePolicy.Always;
});
In Configure function:
app.UseCookiePolicy();
However, I could not find a detailed explanation of what impact these settings will cause for an existing application.
Ours is a web service application runing .net core 2.2
Microsoft documentation definitions:
CookiePolicyOptions.HttpOnly Property => Affects whether cookies must be HttpOnly
CookiePolicyOptions.Secure Property => Affects whether cookies must be Secure.
And that’s it. no more detailed explanation.
If someone can elaborate on what effect these settings will cause, much appreciated!!