Created
October 27, 2018 03:22
-
-
Save NirmalAriyathilake/e7b10732f76be96f904119bf88f934bf to your computer and use it in GitHub Desktop.
OAuth And Social Login - logout.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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