Do you have any idea why cookie is not set in client? It is sent from backend:
func loginEmail(_ req: Request) throws -> Response
{
let params = try req.content.decode(LoginEmailIn.self)
let response = Response(status: .ok)
if params.email == "test" && params.password == "test" {
//req.session.data["userId"] = "abcd"
let cookie = HTTPCookies.Value(string: "abcdef", expires: Date().addingTimeInterval(10000), maxAge: 300000, isSecure: false, isHTTPOnly: true, sameSite: HTTPCookies.SameSitePolicy.none)
response.cookies["userId2"] = cookie
}
//return HTTPStatus.ok
return response
}
it is visible in browser in Network
tab
set-cookie: userId2=abcdef; Expires=Mon, 31 Jan 2022 07:24:55 GMT; Max-Age=300000; Path=/; Secure; HttpOnly; SameSite=None
POST is sent to loginEmail
.