Skip to content

Instantly share code, notes, and snippets.

@nasal
Last active December 27, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasal/7308336 to your computer and use it in GitHub Desktop.
Save nasal/7308336 to your computer and use it in GitHub Desktop.
PHP: logout
<?php
if (isset($_GET['logout'])) {
session_start();
session_unset();
session_destroy();
session_write_close();
setcookie(session_name(),'',0,'/');
session_regenerate_id(true);
header('location: ./');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment