Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!