-
Notifications
You must be signed in to change notification settings - Fork 0
/
logout.asp
63 lines (61 loc) · 2.41 KB
/
logout.asp
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
52
53
54
55
56
57
58
59
60
61
62
63
<% DIM content_type: content_type=Request.ServerVariables("HTTP_ACCEPT")
Session.Abandon
IF (INSTR(UCASE(content_type),"JSON")>0) THEN
Response.ContentType = "application/json"
Response.CharSet = "ISO-8859-1"
%>{
"success": true
}<%
ELSE
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<script type="text/javascript">
// transfers sessionStorage from one tab to another
var sessionStorage_transfer = function (event) {
if (!event) { event = window.event; } // ie suq
if (!event.newValue) return; // do nothing if no value to work with
if (event.key == 'getSessionStorage') {
// another tab asked for the sessionStorage -> send it
localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage));
// the other tab should now have it, so we're done with it.
localStorage.removeItem('sessionStorage'); // <- could do short timeout as well.
} else if (event.key == 'sessionStorage' && !sessionStorage.length) {
// another tab sent data <- get it
var data = JSON.parse(event.newValue);
for (var key in data) {
sessionStorage.setItem(key, data[key]);
}
}
};
// listen for changes to localStorage
if (window.addEventListener) {
window.addEventListener("storage", sessionStorage_transfer, false);
} else {
window.attachEvent("onstorage", sessionStorage_transfer);
};
// Ask other tabs for session storage (this is ONLY to trigger event)
if (!sessionStorage.length) {
localStorage.setItem('getSessionStorage', 'foobar');
localStorage.removeItem('getSessionStorage', 'foobar');
};
</script>
</head>
<body>
<div>
<label>Hasta luego!</label>
</div>
<script type="text/javascript">
if (typeof (sessionStorage) !== "undefined") {
sessionStorage.setItem("userId",undefined);
}
</script>
</body>
</html>
<% END IF %>