Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

209
Visualizações
Why Set-Cookie is not stored?

I have following HTTP response:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: accept, authorization, content-type, origin, x-requested-with, user-agent, access-control-allow-origin, crossdomain, access-control-allow-credentials, x-requested-with
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, DELETE, PATCH
Access-Control-Allow-Origin: https://speechifai-dashboard-fe.herokuapp.com
Access-Control-Max-Age: 600
Connection: keep-alive
Content-Length: 35
Content-Type: application/json; charset=utf-8
Date: Fri, 25 Feb 2022 05:52:17 GMT
Server: Cowboy
Set-Cookie: sessionIdSp=+5BtM+x+ZZ262Vs362qgUUmJE8PXd12G+AwMSdH14JQ=; Path=/; Secure; HttpOnly; SameSite=Lax

Link is here, you can try: https://speechifai-dashboard-fe.herokuapp.com/createPost

So frontend connect to backend, backend sends cookie, but I can not see under Cookies, why? What do I miss?

I have a Vapor backend:

It has following setting, what is wrong?

app.middleware.use(CORSMiddleware(configuration: .init(
    allowedOrigin: .originBased,//.originBased,
    allowedMethods: [.GET, .POST, .PUT, .OPTIONS, .DELETE, .PATCH],
    allowedHeaders: [.accept, .authorization, .contentType, .origin, .xRequestedWith, .userAgent, .accessControlAllowOrigin, .init("crossDomain"), .accessControlAllowCredentials, .xRequestedWith],
    allowCredentials: true
)), at: .beginning)

// Change the cookie name to "foo".
app.sessions.configuration.cookieName = cookieName

// Configures cookie value creation.
app.sessions.configuration.cookieFactory = { sessionID in
    print("sessionID.string: \(sessionID.string)")
    return .init(string: sessionID.string, isSecure: true, isHTTPOnly: true)
}

Calling here backend from React frontend:

axios({
  method: "post",
  url: "registerEmail",
  data: {},
  headers: {
    "Content-Type": "application/json",
    crossDomain: true,
  },
})
  .then((res) => {
    dispatch(setGetUser(res.data));
  })
  .catch((err) => console.error(err));
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda