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

239
Visualizações
Get cookie's value from another domain (both behind the same virtual reverse proxy server)

What I am trying to achieve is when a user is logged in on main-app-site.com they are also logged in when visiting client-site-a.com, client-site-b.com, and so on.

Please, read on as client-site-a.com is a reverse proxy of content on main-app-site.com hence, both $_SERVER['HTTP_HOST'] and $_SERVER['HTTP_SERVER'] are set to main-app-site.com on all subdomains and custom domains.

In other words, I want to retrieve a cookie from main-app-site.com from all other domains on the same virtual proxy server.

main-app-site.com is where users log in (currently via ajax) from client-site-a.com.

I have read and tried many things (iframe, js, PHP) to no avail.

Also, have add_header "Access-Control-Allow-Origin" "*"; set already, and that works fine when accessing main-app-site.com via AJAX from client-site-a.com

I would think since they have the same HOST & SERVER, the browser would share the cookie of that host/server, but that doesn't seem to be the case — or maybe I am missing an NGINX directive that I should add?

I have exhausted all I could learn and try.

Anything else I can try at this point?

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