diff --git a/src/functions/AdapterSessionFunctions.php b/src/functions/AdapterSessionFunctions.php index 3b4e827..04cbb5b 100644 --- a/src/functions/AdapterSessionFunctions.php +++ b/src/functions/AdapterSessionFunctions.php @@ -98,3 +98,19 @@ function session_regenerate_id(bool $delete_old_session = false): bool return Http::sessionRegenerateId($delete_old_session); } + +/** + * Free all session variables + * + * @link https://www.php.net/manual/en/function.session-unset.php + */ +function session_unset(): bool +{ + if(session_status() === PHP_SESSION_ACTIVE) { + $_SESSION = []; + + return true; + } + + return false; +}