samedi 18 février 2017

My cookies are never set when there is also a redirect included in the HTTP header. Why is this?

I'm using CGI to generate the headers. Cookies are set properly if I don't have any redirect included in the header, but not if the header specifies to redirect to somewhere else.

This works:

Set-Cookie: user=thing
Set-Cookie: pass=otherthing; httponly
Content-Type: text/html; charset=utf-8

However, this doesn't work:

Set-Cookie: user=thing
Set-Cookie: pass=otherthing; httponly
Status: 302 Found
Location: /

Does anyone know why example 2 does not set the cookies?




Aucun commentaire:

Enregistrer un commentaire