Set cookie header not working

I am developing a small w / Go site and I am trying to set a cookie from my server.

I am running the server on localhost, with 127.0.0.1 with the alias subdomain-dev.domain.com on port 5080 .

My When I get an answer for my POST before subdomain-dev.domain.com:5080/login , I see the set-cookie header. The answer is as follows:

 HTTP/1.1 307 Temporary Redirect Location: / Set-Cookie: myappcookie=encryptedvalue==; Path=/; Expires=Fri, 13 Sep 2013 21:12:12 UTC; Max-Age=900; HttpOnly; Secure Content-Type: text/plain; charset=utf-8 Content-Length: 0 Date: Fri, 13 Sep 2013 20:57:12 GMT 

Why don't Chrome or Firefox write this down? In Chrome, it does not appear on the Resources tab. In FF, I do not see this either. And I also do not see it in future request headers.

+6
source share
1 answer

See what is the Secure string in the cookie?

Yes, me too. But only after a few hours.

Make sure you access your site via SSL (https: // at the beginning of the URL) if you have the Secure flag set.

If you are developing locally and do not have a certificate, make sure you skip this option.

+18
source

Source: https://habr.com/ru/post/953804/


All Articles