Which of the following is a correct way to destroy a specific session variable in PHP?
- unset($_SESSION['variable_name']);
- session_destroy();
- session_unset();
- session_unset($_SESSION['variable_name']);
The correct way to destroy a specific session variable in PHP is by using the unset function, followed by the variable name in $_SESSION. This clears the variable without destroying the entire session.
Loading...