-
Notifications
You must be signed in to change notification settings - Fork 56
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
Faces 4.0: add support for SameSite attribute in ExternalContext#addResponseCookie() properties #1570
Comments
Finally! I am bummed this never made it in before right now I use an Undertow hack to put the SameSite on all my Session cookies. |
It looks like Cookie#setAttribute() has more chance: jakartaee/servlet#401 |
That has been merged 🎉 Unfortunately not 100% futureproof but better than nothing. We'll now have to wait for some sort of 5.1.0-M1 before we can catch up @gregw any plans for a M1? |
Looks like next servlet version is going to be 6.0 instead of 5.1. However, there's still no M1 or alike in Maven which could be used to compile against. @arjantijms can you please kick off it? The deadline is otherwise going to be tight. |
@BalusC @arjantijms |
Oh crap. Servlet API is holding up all its dependent APIs again. @arjantijms you have admin privileges on servlet project as well, can you please nonetheless kick off a sort of M1 in Maven? Then we can move forward. |
Prepare support for SameSite; Servlet 5.1.0-M1 should be out by now but isn't in Maven yet
SameSite value should be String not Boolean
Specify support for custom cookie attributes such as SameSite
Implement support for custom cookie attributes such as SameSite
I went a step further: I've specified that "any custom attribute" is supported. This way it's more future-proof. |
I think that is a great idea |
implemented in both mojarra and myfaces |
That was a long journey, but finally! :) |
@BalusC @arjantijms how should JSF internal cookies like flash use SameSite? |
Ideally inherit it from JSESSIONID config. Since Servlet 6.0 it's possible to configure as follows: <session-config>
<cookie-config>
<attribute>
<attribute-name>SameSite</attribute-name>
<attribute-value>NONE</attribute-value>
</attribute>
</cookie-config>
</session-config> And to obtain as follows: String sameSite = servletContext.getSessionCookieConfig().getAttribute("SameSite"); See also https://www.eclipse.org/lists/servlet-dev/msg00410.html |
CC @melloware |
This is slick! However, I am hesitant to do this because what do we do if they are using stateless views or completely stateless JSF?? They can still use FlashScope and PF Download cookies right without a Session? |
yeah but either:
i think a mix of 1) and 2) is enough actually - at least in servlet 6 |
OK MyFaces PR submitted. |
@BalusC I'm not seeing the following being as valid due to Am I missing something obvious here, or did this not make it into the spec.
|
Works for me in Tomcat 10.1. If you're referring to IDE validation, report issue at maintainers of IDE. This isn't the responsiblity of Faces spec. |
It's most likely going to be added to Servlet 5.1:
The text was updated successfully, but these errors were encountered: