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

52
Visualizações
duplicated cookies and wrong order used for http request

I am using Fetch API with {credentials:"include"} for requests described down bellow.

Also my HTTP server returning Access-Control-Allow-Credentials: true header.


I have a 3 domains:

  1. example.com
  2. application.example.com
  3. server.example.com

🍪 server.example.com/sign-in will send a cookie key with Domain=example.com; HttpOnly=true; Path=/. The key is a encoded string with all possible permissions included.

As I found out the key is accessible from every single subdomain which is good. So application subdomain have key as well.

🍪 But application.example.com/test will send a cookie key with Domain=application.example.com; HttpOnly=true; Path=/test which is a key with ->limited<- permissions included.

So the cookies for subdomain application looks like:

Name Domain Path HttpOnly
key .example.com / true
key .application.example.com /test true

The problem

The problem starts when I am trying to request server.example.com from application.example.com. The first cookie (wildcard) is used. But why? I am on application subdomain and also I have more relevant (the second) cookie.

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