<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: access");
header("Access-Control-Allow-Methods: GET");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

session_start();
$return =
[
    "success" => 0,
    "user" => null
];

if (isset($_SESSION['user'])) {
    $return =
        [
            "success" => 1,
            "user" => $_SESSION['user']
        ];
}
echo json_encode($return);
?>