Question
Evonsys (PVT) LTD
LK
Last activity: 14 Mar 2025 7:10 EDT
How to Enforce Secure Cookies in Pega?
Hi Team,
I’m working on securing cookies in Pega and facing the issue of "Missing Secure Flag". I understand that without the Secure flag, cookies might be transmitted over HTTP instead of HTTPS, making them vulnerable to interception.
Here are the steps I’m considering:
-
Enable Secure Cookies in DSS (Dynamic System Settings):
- Owning Ruleset:
Pega-Engine - Setting Purpose:
http/secureCookies - Value:
true
- Owning Ruleset:
-
Update
prconfig.xml:- Add:
<env name="http/secureCookies" value="true" />
- Add:
After applying these changes, I also plan to verify the cookies in Chrome DevTools to confirm the Secure flag is set.
Has anyone implemented this in their Pega environment? Are there any additional considerations or steps I should take to ensure that the Secure flag is properly enforced?
Thanks in advance for your help!
Eranda.
@Eranda Weerasingha as you have not had any response, I will provide some input.
NOTE: The below answer came from a GenAI tool. It is imperative you check the References used to come with this answer.
---------------------------------------------
Your approach to enabling secure cookies is on the right track, but there are some important nuances and additional security measures to consider for complete implementation.
Regarding Your Current Implementation Plan
The steps you outlined for enabling secure cookies are generally correct. However, there's a slight difference in the dynamic system setting usually referenced in Pega documentation:
http/secureCookiesto true in DSSprconfig/HTTP/SetSecureCookie/defaultBoth settings can work to enable the secure flag, but the latter is more consistently referenced in official documentation. You might want to verify both settings in your environment.
Additional Security Considerations
Beyond your current plan, consider implementing these additional measures for comprehensive cookie security:
@Eranda Weerasingha as you have not had any response, I will provide some input.
NOTE: The below answer came from a GenAI tool. It is imperative you check the References used to come with this answer.
---------------------------------------------
Your approach to enabling secure cookies is on the right track, but there are some important nuances and additional security measures to consider for complete implementation.
Regarding Your Current Implementation Plan
The steps you outlined for enabling secure cookies are generally correct. However, there's a slight difference in the dynamic system setting usually referenced in Pega documentation:
http/secureCookiesto true in DSSprconfig/HTTP/SetSecureCookie/defaultBoth settings can work to enable the secure flag, but the latter is more consistently referenced in official documentation. You might want to verify both settings in your environment.
Additional Security Considerations
Beyond your current plan, consider implementing these additional measures for comprehensive cookie security:
prconfig/cookie/HttpOnly/defaultto trueVerification Process
Your plan to verify the secure flag in Chrome DevTools is excellent. When checking, ensure that:
Secureflag setHttpOnlyflag is present (if implemented)SameSiteattribute is correctly configured (if implemented)Common Implementation Issues
Some common issues to watch for:
References: