Site icon Learn Web Development & Programming, Artificial Intelligence, WordPress, Shopify Articles

How can we destroy a session in PHP?

We can destroy a session by:

<?php
session_destroy();
?>

To delete a specific session variable, we use

<?php
session_unset($_SESSION['variable_name']);
?>
Exit mobile version