Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #12241 Restore SameSite config as session cookie comment. #12263

Merged

Conversation

janbartel
Copy link
Contributor

User reported not being able set SameSite via old jetty session cookie comment mechanism. This PR restores that, but only for ee8 and ee9.

@janbartel janbartel requested review from gregw and joakime September 12, 2024 06:05
@janbartel janbartel self-assigned this Sep 12, 2024
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use HttpCookieFacade methods instead.

if (comment.contains(SAME_SITE_NONE_COMMENT))
_sessionManager.setSameSite(HttpCookie.SameSite.NONE);
if (comment.contains(PARTITIONED_COMMENT))
_sessionManager.setPartitioned(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the techniques in HttpCookieFacade here.
Bonus is that you can even get a clean comment field too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@janbartel janbartel requested a review from joakime September 12, 2024 22:19
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the now unused constants?

Comment on lines 624 to 628
protected static final String SAME_SITE_COMMENT = "__SAME_SITE_";
protected static final String SAME_SITE_NONE_COMMENT = SAME_SITE_COMMENT + "NONE__";
protected static final String SAME_SITE_LAX_COMMENT = SAME_SITE_COMMENT + "LAX__";
protected static final String SAME_SITE_STRICT_COMMENT = SAME_SITE_COMMENT + "STRICT__";
protected static final String PARTITIONED_COMMENT = "__PARTITIONED__";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants are no longer needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@janbartel janbartel merged commit 5105afa into jetty-12.0.x Sep 15, 2024
12 checks passed
@janbartel janbartel deleted the jetty-12.0.x-12241-restore-samesite-in-cookie-comment branch September 15, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants