Skip to content

Instantly share code, notes, and snippets.

@scarstens
Created May 5, 2014 17:14
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 scarstens/11542412 to your computer and use it in GitHub Desktop.
Save scarstens/11542412 to your computer and use it in GitHub Desktop.
Destroy PHP session
session_unset();
session_destroy();
session_write_close();
setcookie(session_name(),'',0,'/');
session_regenerate_id(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment