I’m having problems with the set-cookies in my application (spring boot). In the fist one it works fine, but in the second one don´t.
First:
HTTP/1.1 302
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Set-Cookie: token=name; Max-Age=2147483647; Expires=Wed, 09 Jul 2092 18:13:47 GMT; Domain=localhost; Path=/; Secure; SameSite=None
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Location: http://localhost:3000/backoffice/
Content-Length: 0
Date: Fri, 21 Jun 2024 14:59:40 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Second:
HTTP/1.1 200
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Access-Control-Allow-Origin: *
Set-Cookie: token=name; Expires=Wed, 09 Jul 2092 18:15:44 GMT; Domain=localhost; Path=/; Secure; SameSite=None
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 0
Date: Fri, 21 Jun 2024 15:01:37 GMT
Keep-Alive: timeout=60
Connection: keep-alive
I tested on different browser and tried changing secure, sameSite and HttpOnly parameters but nothing worked. And also, tested on postman and it works fine for both.
New contributor
michel brito is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.