-
Notifications
You must be signed in to change notification settings - Fork 0
/
sessionEnd.php
51 lines (43 loc) · 1.55 KB
/
sessionEnd.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
session_destroy();
//header("Location: ./login.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>Logging Out...</title>
<script src="https://apis.google.com/js/platform.js"></script>
<meta name="google-signin-client_id" content="783497289681-md44u43oh563o2jrf0gjsfbtgr6oh2qg.apps.googleusercontent.com">
<script type="text/javascript">
var tries = 0;
function load() {
gapi.load('auth2', function() {
gapi.auth2.init();
});
signOut();
}
function signOut() {
if(tries < 3){
try{
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function() {
sessionStorage.clear();
window.open("./login.php", "_self");
});
tries += 3;
}
catch(e){setTimeout(signOut, 500);}
}
else{
sessionStorage.clear();
window.open("./login.php", "_self");
}
}
</script>
</head>
<body onload="load();">
<h1>Logging you out...</h1>
<h2>If it takes more than 5 seconds, please follow this link <a href="./login.php">to the Login Page</a></h2>
</body>
</html>