<?php
// Always include this FIRST (before ANY output) in every admin page (including login/logout)
declare(strict_types=1);

// Unique cookie for ADMIN app
session_name('ADMINSESS');
session_set_cookie_params([
  'lifetime' => 0,
  'path'     => '/adminvideonew',                  // Scope only to this folder
  'domain'   => $_SERVER['HTTP_HOST'] ?? '',
  'secure'   => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'),
  'httponly' => true,
  'samesite' => 'Lax',
]);

if (session_status() !== PHP_SESSION_ACTIVE) {
  session_start();
}
