<?php
require_once '../includes/config.php';
session_start();

header('Content-Type: application/json');

if (isset($_SESSION['user_id'])) {
    echo json_encode([
        'status' => 'success',
        'logged_in' => true,
        'user' => [
            'id' => $_SESSION['user_id'],
            'full_name' => $_SESSION['full_name']
        ]
    ]);
} else {
    echo json_encode([
        'status' => 'error',
        'logged_in' => false
    ]);
}
?>
