chrome
1、右上角...点击更多工具->开发者工具
2、application->cookies 右侧绿色即为存储的内容。ps:Stroage中local storage session等都是存储数据的不同方式。
ps:Chrome不支持本地使用cookie,Chrome浏览器为了安全只支持online-cookie。也就是,本地不可以设置cookie。只有将项目部署在Server上再从浏览器访问才能使用访问。 例如chrom无法设置cookie内容:页面结果
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
</head>
<body>
<script type="text/javascript">
document.cookie = 'name=john';
document.write(document.cookie);
</script>
</body>
</html>
IE浏览器
1、使用开发者工具(按下F12);
2、选择“Console”选项卡,往Console(控制台)输入document.cookie并按下回车键便可查看当前cookie。
案例演示:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
</head>
<body>
<script type="text/javascript">
document.cookie = 'name=john';
document.write(document.cookie);
</script>
</body>
</html>