auth.php 302 B

12345678
  1. <?php
  2. // Shared session auth guard — include at the top of every protected HTML page.
  3. if (session_status() === PHP_SESSION_NONE) session_start();
  4. if (empty($_SESSION['pl_authed'])) {
  5. $next = $_SERVER['REQUEST_URI'] ?? '/';
  6. header('Location: /login.php?next=' . urlencode($next));
  7. exit;
  8. }