<?php
session_start();
header('Content-Type: application/json');

echo json_encode([
    'loggedIn' => isset($_SESSION['uid']),
    'userId' => isset($_SESSION['uid']) ? $_SESSION['uid'] : null,
    'userType' => isset($_SESSION['usertype']) ? $_SESSION['usertype'] : null,
    'sessionData' => [
        'uid' => isset($_SESSION['uid']) ? $_SESSION['uid'] : 'not set',
        'usertype' => isset($_SESSION['usertype']) ? $_SESSION['usertype'] : 'not set'
    ]
]);
?>
