-
Notifications
You must be signed in to change notification settings - Fork 117
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
ExternalContext.addResponseCookie does not support different properties #5165
Comments
@NicolaIsotta here is what PrimeFaces code does... Not sure if this helps at all. PrimeRequestContext requestContext = PrimeRequestContext.getCurrentInstance(context);
PrimeApplicationContext applicationContext = requestContext.getApplicationContext();
if (requestContext.isSecure() && applicationContext.getConfig().isCookiesSecure()) {
properties.put("secure", true);
if (applicationContext.getEnvironment().isAtLeastJsf40()) {
properties.put("SameSite", applicationContext.getConfig().getCookiesSameSite());
}
}
context.getExternalContext().addResponseCookie(name, value, properties); |
Aside from that, there's another problem. Lines 17 to 27 in e651989
But mojarra 4 targets servlet 6 api in the pom: Lines 51 to 56 in e651989
So what's the correct version? |
Excellent find. This badly slipped through because there's no TCK test for that. |
Reminder/note to self: TCK couldn't be created because currently used GF 7.0.0-M4 hasn't it implemented yet and because newer milestones are not in Maven Central due to dependency issues. We need to wait until GF 7.0.0 is released. |
this didn't work in currently used GF 7.0.0-M4, need to wait until GF 7.0.0 is final
Describe the bug
I've added SameSite to my app cookies using Tomcat Cookie Processor.In some cases (eg. PrimeFaces filedownload) the page breaks beacuse of an IllegalArgumentException thrown by mojarra ExternalContextImpl at this line:mojarra/impl/src/main/java/com/sun/faces/context/ExternalContextImpl.java
Line 765 in e651989
To Reproduce
Steps to reproduce the behavior:
1. Add<CookieProcessor sameSiteCookies="strict" />
to the context.xml of your app2. Deploy to Tomcat 10
3. Navigate to a page which has p:fileDownload
4. Try to download the file
Expected behavior
No exception.
Screenshots
![cookie error](https://user-images.githubusercontent.com/18428155/200803502-93923e29-82dd-4c49-902f-6a9257235e38.jpg)
Additional context
Tomcat 10.0.20
mojarra 4.0.0
primefaces 12.0.0
The text was updated successfully, but these errors were encountered: