I'm trying to set (change) cookie in Chrome Dev tool, but it only stores the name, not the value.
Steps:
localhost:3000
Actual result: the cookie with its name is there, but value is empty.
Funny part - this was working a couple of days ago, can't think of what has changed since then.
OS - MacOS v. 10.14.3 Chrome - v. 73.0.3683.86 (Official Build) (64-bit)
Also I noticed the cookie is highlighted in red color (see MyCookie on the screenshot).
Setting cookie for this page works just fine in Firefox.
Already tried:
127.0.0.1:3000
instead of localhost
You need to set a cookie locally that is Secure , or SameSite:none , or has the __Host prefix. Secure cookies are set only on HTTPS, but not on http://localhost for all browsers.
Check out the OPTIONS response header ACCESS-CONTROL-ALLOW-CREDENTIAL whether it is set to true . If the server doesn't allow credentials being sent along, the browser will just not attach cookies and authorization headers. So this could be another reason why the cookies are missing in the POST cross-site request.
Open Chrome DevTools. Click the Application tab to open the Application panel. Under Storage expand Cookies, then select an origin.
Right-click and click on Inspect Element to open the developer console. Go to the Storage tab. Expand the Cookies menu and select the website to check cookies. On the right side of the console, you will see the cookies that have been set on the website.
With the new versin of chrome Max-age of cooke can set in following way using
dev tools -> console set document.cookie manually.
document.cookie='token=1234'.
We will get following things
Cookie Name: token
Cookie Value: 1234
Expires / Max-Age: 2019-12-26T15:22:22.000Z
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With