Off Topic
Ha! So simple and for all these years I've been wondering how to do it, how did I not think of this. Thanks! :)
On Topic
session_unset();
session_destroy();
Make sure you have checks on your "main" page or an authentication page which is included in that PHP file.
if(!isset($_SESSION['sessionName']) || empty(trim($_SESSION['sessionName'])) || $_SESSION['sessionName'] == "") {
// Redirect to login page and give them error.
header("refresh:3; url=login.php");
return;
} else {
// Session is set, redirect to "main" page
header("Location: main.php");
return;
}