question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

this.cookies.set() cannot set cookie to chrome correctly

See original GitHub issue

I came across a strange scene.

In the entry js file:

app.use(function*(next) {
    this.cookies.set('test', 999999);
    return yield next;
})

This is ok in both HTTP Response Header and Chrome Devtool Resources 's Cookies.

But…

When I put the this.cookies.set to Get Reponser

app.get('/v1/test', function *(next) {
    this.cookies.set('test1', 66666);
    this.body = { code: 200, message: 'success'}
    return yield next;
})

The HTTP Reponse Header is ok

Set-Cookie: test1=66666; path=/; httponly

The Chrome Devtool Resources’s Cookies display no cookie !

I have debugg this for long time, please help me ~

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
dead-horsecommented, Mar 22, 2016
1reaction
luckydrqcommented, Mar 23, 2016

@freestyle21 @dead-horse I think the issue aims at receiving cookies problem, not sending. If i’m wrong, correct me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Chrome can't set cookie
I have a response from my server. Response Headers contains a valid Set-Cookie. Chrome Response/Cookies says ...
Read more >
Turn cookies on or off - Computer - Google Account Help
On your computer, open Chrome. · At the top right, click More More and then Settings. · Under "Privacy and security," click Site...
Read more >
7 Keys to the Mystery of a Missing Cookie
Solution tip: Change the code where you are setting the cookie to set the Domain attribute accordingly. 6. Cookie Name is Prefixed with...
Read more >
Set-Cookie - HTTP - MDN Web Docs
To send multiple cookies, multiple Set-Cookie headers should be sent ... cannot set cookies with the Secure attribute (since Chrome 52 and ...
Read more >
How do I view, add or edit Cookies in Google Chrome?
@s3m3n If you want to change an HttpOnly cookie without using third party plugins, you can first use the Resources tab to delete...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found