Repository navigation
[#2962] Jakarta EE: secure-session-cookie.disabled is ignored in Faces Production mode - #2963
Open
AndrewG10i wants to merge 3 commits into
Open
AndrewG10i wants to merge 3 commits into
AndrewG10i wants to merge 3 commits into
Conversation
- Group the Faces stage checks in EnvironmentLoaderListener so the explicit opt-out applies in Production. Previously, operator precedence let the Production check bypass the opt-out. - Add ShiroSessionCookieIT to verify that the container-managed JSESSIONID cookie carries Secure by default and omits it when the opt-out is enabled.
lprimak
approved these changes
Nov 20, 2026
lprimak
approved these changes
Nov 20, 2026
Contributor
|
Thank you for your contribution, Andrew, I removed the slow IT tests, as they added 2 deployments (x3 integration mode tests) which added much time to integration testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2962: [Bug] Jakarta EE: secure-session-cookie.disabled is ignored in Faces Production mode
This PR fixes an issue in
EnvironmentLoaderListenerwhere theorg.apache.shiro.ee.secure-session-cookie.disabled=trueconfiguration parameter was not respected when Jakarta Faces was running in Production mode (jakarta.faces.PROJECT_STAGE=Production).Due to incorrect operator precedence in the existing condition, the Production check could bypass the explicit opt-out, causing Shiro to force the
Secureattribute on the servlet container's session cookie.Changes
EnvironmentLoaderListenerso the explicit opt-out applies regardless of the Jakarta Faces project stage.ShiroSessionCookieITto verify the behavior using two Production deployments with container-managed sessions.CreateSessionServlettest fixture that creates an HTTP session usingrequest.getSession(true).Set-Cookieheaders and verify that:JSESSIONIDcookie includes theSecureattribute.org.apache.shiro.ee.secure-session-cookie.disabled=true, Shiro does not force theSecureattribute.Testing
Verified the regression before and after the fix:
Executed from the repository root:
Contribution checklist
Fixes #2962to link and close the issue upon merge.mvn verifycompleted successfully.Licensing
AI Assistance
This contribution was prepared with the assistance of OpenAI Codex (GPT-6.2 Sol) for code analysis, implementation, and regression testing. The changes and test results were reviewed and validated by the contributor.