<?php
/**
 * Retry License Verification
 * Clears session so the next page load performs a fresh license check with the server.
 * Use when the user has renewed and the date was extended but the app still shows expired.
 */
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// Clear all license-related session so license_check.php will do a real-time API call
unset(
    $_SESSION['license_last_attempt'],
    $_SESSION['license_verified'],
    $_SESSION['license_expired'],
    $_SESSION['license_expiry_message']
);

// Redirect to dashboard; layout will run license_check.php and hit the API again
header('Location: index.php');
exit;
