DIDS-Coursework/DIS-COMP4039-CW2-psxrp11-20450011/psxrp11-20450011_InstallationFiles/isLoggedIn.php

11 lines
286 B
PHP

<?php
session_start();
header('Content-Type: application/json');
if (isset($_SESSION["username"]))
{
echo json_encode(array("message" => "ok", "username" => $_SESSION["username"], "admin" => $_SESSION["admin"]));
}
else
{
echo json_encode(array("message" => "not logged in"));
}