Skip to content

Instantly share code, notes, and snippets.

@NirmalAriyathilake
Created October 27, 2018 03:22
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 NirmalAriyathilake/e7b10732f76be96f904119bf88f934bf to your computer and use it in GitHub Desktop.
Save NirmalAriyathilake/e7b10732f76be96f904119bf88f934bf to your computer and use it in GitHub Desktop.
OAuth And Social Login - logout.php
<?php
session_start();
//remove PHPSESSID from browser
if ( isset( $_COOKIE[session_name()] ) )
setcookie( session_name(), null, time()-3600, '/' );
//clear session from globals
$_SESSION = array();
//clear session from disk
session_destroy();
?>
<html>
<body>
<script>
alert("You are Successfully Logged out!");
window.location.href = "index.php";
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment