Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
<?php
/**
* API Endpoint: Check Authentication Status
*/
session_start();
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Credentials: true');
if (isset($_SESSION['user_id'])) {
echo json_encode([
'success' => true,
'authenticated' => true,
'user' => [
'user_id' => $_SESSION['user_id'],
'username' => $_SESSION['username'],
'email' => $_SESSION['email'],
'full_name' => $_SESSION['full_name']
]
]);
} else {
echo json_encode([
'success' => true,
'authenticated' => false
]);
}