ngx-cookie
ngx-cookie copied to clipboard
Cookie set on server cannot be read on server returns undefined.
Description Cookies saved on angular SSR are returned as undefined while values are there in browser cookies. This is happening only on the HTTPS site with localhost everything is working as expected.
To Reproduce Steps to reproduce the behavior:
- Save cookies on the server-side and use them on the server-side also and you will get the undefined value.
Environment:
- Angular version [11]
- Angular Universal version [11]
- ngx-cookie : ["^5.0.2"],
- ngx-cookie-backend: ["^5.0.2"]
Based on skimming the source code. Its because when you set a cookie on SSR you set it to the response object. When you read cookies the service reads from the request object.
The issue I created #465 may be duplicate, although the issue I'm experiencing is also running SSR in dev on localhost. Its possible if the localhost run being processed was not using SSR, that the experience would work. This is why it could potentially be a duplicate issue.
Additionally the issue may have been tough to track down without knowing multiple cookies on a domain needed to be set.
@Muzummil can you recheck with 6.0.1?
@salemdar It seems as if 6.0.1 has fixed this issue.