-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(ssr): adds server cookie output via response #320
base: development
Are you sure you want to change the base?
Conversation
Partitioned cookies aren't supported by express yet due to a dependency on an older version of the cookie package. See expressjs/express#5275. Adding an override for a higher version of the cookie package which does support partitioned cookies fixes this.
Deletion uses the cookie setter with a past date in the expiration options. Now that the setter is updated to support server cookies as well, this will work for both client and server cookies.
Quality Gate passedIssues Measures |
When is this going to be merged? Seems like this is capable of solving some significant challenges. |
@blakeoxx I tried this and didn't work as expected. For example, setting cookie in |
@pavankjadda try out this test repo: https://github.com/blakeoxx/ngx-cookie-service-18-test. You can build and start the project with I generated this project with Angular's Additionally, something I noticed was that NG18's SSR defaults to using prerendering. I had to disable this in the builder architect configuration. It's intended behavior that SSR won't run on prerendered routes and not a bug of this code, but perhaps may be worth calling out in the README. Let me know if you need anything else or don't see expected results. |
This brings the fix/feature completed in #315 to the v18 codebase and resolves #266 . It increases the
SsrCookieService
s ability to use the request and response objects provided by Express to read and write cookies on the server side. This also means that cookies written during SSR will be returned to the client in the response headers.This PR also includes less refactors than the previous one, per maintainer request. The only refactors included in this PR were strictly necessary for enabling this feature.