0, 'path' => '/', 'secure' => !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off', 'httponly' => true, 'samesite' => 'Strict' ]); session_start(); /* * ========================================================= * VERIFICATION AUTHENTIFICATION * ========================================================= */ if ( empty($_SESSION['user_id']) || empty($_SESSION['authenticated']) ) { http_response_code(401); header( 'Content-Type: application/json; charset=utf-8' ); echo json_encode([ 'success' => false, 'message' => 'Authentification requise.' ], JSON_UNESCAPED_UNICODE); exit; }