Welcome to WebmasterWorld Guest from 18.104.22.168
Because if there's no session already, session_destroy() will give you an error...
This is the same concept as your initial code - "If I can execute session_destroy it means there's a session to destroy, so do it and redirect."
include ($_SERVER['DOCUMENT_ROOT'] . "/db_connect.php");
// Ther're leaving, update their last online time etc
$member_ID = $_SESSION['member_ID'];
$update = "UPDATE members_log";
$update.= " SET log_lastonline = log_activecheck,";
$update.= " log_isonline = 'n'";
$update.= " WHERE log_mem_ID = '$member_ID'";
// LOG OUT
...the original script I got had literaly 'session start() - if(session destroy)
...when I came to adjust the logout script I got confiused by this and had to ask!