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

if (!isset($_SESSION['user'])) {
    echo json_encode(['status' => 'error', 'message' => 'No session']);
    exit;
}

echo json_encode([
    'status' => 'success',
    'session' => $_SESSION['user'],
    'timestamp' => date('Y-m-d H:i:s')
]);
?>