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

149
Views
Javascript/PHP envía/obtiene cookies a diferentes URI

Necesito enviar cookies entre dos sitios web, el sitio web A y el sitio web B

Código A del sitio web: (JS)

 var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://websiteb.com/?sessid=<?php echo session_id(); ?>', true); xhr.withCredentials = true; xhr.send(null);

Código B del sitio web: (PHP)

 header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Headers: Set-Cookie"); header("Access-Control-Allow-Origin: https://websiteA.tld"); header('Content-Type: application/json'); setcookie('PHPSESSID', $_GET['sessid'], array( 'expires' => time() + $cookielifetime, 'path' => '/', 'secure' => true, 'httponly' => false, 'SameSite' => 'None' ));

Este código solo funciona en mi máquina, pero no en un dispositivo externo.

Aquí están los registros del cartero, sin embargo, solo obtengo las cookies del sitio web A

Registros POST del cartero

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!