public function __construct() { if (session_status() !== PHP_SESSION_ACTIVE) { throw new Exception('Sessions are not active.'); } }