我正在运行Android Honeycomb 3.2.1,我无法让浏览器停止接受cookie.我有以下代码:
first.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="cookie.js"></script>
<script type="text/javascript">
setCookie('testing','test cookie',365);
window.location.href = 'second.html';
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
second.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="cookie.js"></script>
<script type="text/javascript">
var temp = getCookie('testing');
alert(temp);
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
cookie.js:
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name) …Run Code Online (Sandbox Code Playgroud)