Editing: /home/goacom/public_html/scratch_extract/logout.php
<?php // 1. Start the session so we can access it session_start(); // 2. Unset all of the session variables $_SESSION = array(); // 3. Destroy the session cookie. // This is important because just destroying the session data on the server // isn't always enough; we also want to remove the cookie from the user's browser. if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } // 4. Finally, destroy the session. session_destroy(); // 5. Redirect to the login page header("Location: /login.php"); exit; ?>
💾 Save