For this, we will use session_destroy(). This function destroys all defined sessions.

<?php
session_start();
session_destroy();
?>