Fetch Api unable to get Session from PHP server
I am using Fetch Api in my application. I've got a PHP server page to get session data which was already defined before. It seemd like this: <?php header('Content-Type: application/json; charset=UTF-8'); header('Access-Control-Allow-Origin: *'); session_start(); // $_SESSION['data'] already defined before $result = array(); // print_r($_SESSION['data']); if (isset($_SESSION['data'])) { $result = $_SESSION['data']; $result['code'] = 'ok'; } else { $result['code'] = 'error'; } echo json_encode($result, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); I also got another html page to get the