Why you’re being logged out
- Your custom Set-Cookie is likely overwriting the Kentico session cookie for the admin site, breaking the authentication
- This is normal if you manually touch cookies in admin responses
- The redirect to login when accessing the Media Library is a symptom of lost auth state
Recommendation - Do not manually set the cookie headers for admin-related requests.
Instead, configure Kentico to output cookies with the attributes that pass your security scan:
<add key="CMSAdminCookiesSameSiteNone" value="true" />
<add key="CMSEnableHttpOnlyCookies" value="true" />
<add key="CMSEnableSecureCookies" value="true" />
If the scan is still flagging them:
Confirm the scan is targeting the right cookies (some might be public, not admin cookies).
If Kentico’s cookies already match best practices, this is indeed a false positive and should be marked as such in the report.
It’s not a Kentico bug-- manually setting Set-Cookie for admin requests will break login.
The correct approach is to configure cookies in Kentico’s web.config, not override them per response. If configured correctly and the scan still flags them, have your security team mark it as a false positive.