Why is the function session_unregister() causing a fatal error in PHP?

The function session_unregister() is causing a fatal error in PHP because it has been deprecated since PHP 5.3 and removed in PHP 5.4. To solve this issue, you should use the unset() function to unset a session variable instead.

<?php
session_start();

// Unset a session variable
unset($_SESSION['variable_name']);
?>