Created
May 5, 2019 17:56
-
-
Save flipjs/889bfa8354bb192f73e707f79db2d5b0 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/nufumuz
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
console.log('hello world!') | |
localStorage.setItem('hello', 'world') | |
document.cookie = 'appType=legacy; path=/; domain=jsbin.com' | |
document.cookie = 'hello=world;path=/;domain=jsbin.com' | |
document.cookie = 'foo=bar; path=/; domain=jsbin.com' | |
console.log('======'+document.cookie+'==========') | |
//if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
try { | |
document.cookie = 'appType=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
document.cookie = 'hello=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
console.log('success!') | |
} catch (e) { | |
console.log('ERROR:', e) | |
} | |
} else { | |
console.log('cookie NOT found!') | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">console.log('hello world!') | |
localStorage.setItem('hello', 'world') | |
document.cookie = 'appType=legacy; path=/; domain=jsbin.com' | |
document.cookie = 'hello=world;path=/;domain=jsbin.com' | |
document.cookie = 'foo=bar; path=/; domain=jsbin.com' | |
console.log('======'+document.cookie+'==========') | |
//if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
try { | |
document.cookie = 'appType=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
document.cookie = 'hello=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
console.log('success!') | |
} catch (e) { | |
console.log('ERROR:', e) | |
} | |
} else { | |
console.log('cookie NOT found!') | |
}</script></body> | |
</html> |
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
console.log('hello world!') | |
localStorage.setItem('hello', 'world') | |
document.cookie = 'appType=legacy; path=/; domain=jsbin.com' | |
document.cookie = 'hello=world;path=/;domain=jsbin.com' | |
document.cookie = 'foo=bar; path=/; domain=jsbin.com' | |
console.log('======'+document.cookie+'==========') | |
//if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
if (document.cookie.match(/\bappType=legacy;?\b/)) { | |
try { | |
document.cookie = 'appType=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
document.cookie = 'hello=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=jsbin.com' | |
console.log('success!') | |
} catch (e) { | |
console.log('ERROR:', e) | |
} | |
} else { | |
console.log('cookie NOT found!') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment