cooki-test-svelte/www/public/api/get.php

16 lines
500 B
PHP
Raw Permalink Normal View History

2023-03-27 12:29:52 +00:00
<?php
//session_set_cookie_params(time() + (86400 * 30), "/","egytalk.se");
session_start();
if(isset($_SESSION['id'])){
$result["phone"] = "343434";
}else{
$result["phone"] = "999999";
}
$_SESSION['id'] = "12-12";
setcookie("fromget", "Funkar igen", time() + (86400 * 30), "/",".egytalk.se",false, true);
//header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true");
header('Content-Type: application/json');
echo json_encode($result, JSON_UNESCAPED_UNICODE);