Cookie not being set in Chrome versions > 80 with ngx-cookie-service 2.4.0
See original GitHub issueExpected Behavior
Using ngx-cookie-service 2.4.0, when a cookie is being set with key, value, Chrome browser should set the cookies in all browsers. this.cookieService.set(‘runOffline’, ‘true’);
Actual Behavior
No cookie is being set in the chrome browsers with version > 80(the latest version).
Reason
For some reason there are other libraries that are creating cookies and the cookies found in document.cookie does not start with a space. So setting a cookie in this condition does not actually set the cookie.
Steps to Reproduce the Problem
Just download the latest version of chrome and set the cookie
Specifications
- Version: 2.4.0
- Browser: Chrome Version 80.0.3987.132
- OS: Ubuntu 18.04
Steps to Reproduce the Problem
Set the cookie the traditional way by leaving a space initially eg.
document.cookie = " runOffline=true; " + document.cookie
Notice the space in the beginning for some reason works well.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:35 (12 by maintainers)
Top Results From Across the Web
Latest Chrome update blocks unsecure cookies in Angular
A cookie associated with a resource at http://tradmin.novlence.com/ was set with `SameSite=None` but without `Secure`. It has been blocked, as ...
Read more >How Your Websites and Apps Could Be Broken Right Now by ...
Ngx-cookie-service has had a known issue setting cookies on Chrome browsers, but this issue was fixed. The fix was to set cookies, making...
Read more >Angular 8 Document.Cookie Does Not Set Cookie In Http ...
Using ngxcookieservice 2.4.0 when a cookie is being set with key ... CSDNCookie not being set in Chrome versions > 80 with ngxcookieservice...
Read more >Open Source Used In slido-test 3.0 - Cisco
This document contains licenses and notices for open source software used in this product.
Read more >Notice - Product documentation - NetApp
with various versions of the ONTAPSelect products. ... or entities who created the Work or if no individual or entity can be identified, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Version 3.0 still doesn’t work
macOS, Chrome Version 80.0.3987.132 (Official Build) (64-bit)
temporary fix: pass all arguments when setting a new cookie. this.cookieService.set(‘name’, ‘John’, null, null, null, null, null);
@stevermeister yes it should fix it.
But in the case where a cookie is set with the samesite = none (via the cookieService.set method) the secure flag always has to be set. So I don’t know if ngx-cookie-service should override the secure flag if mode is
none
Doing this will result with a reject from the browser :
Doing this will work
Doing this will work