html session,local,cookie存储
2021-05-29 17:04
标签:storage 获取 set 字符 客户 大小 val 临时 value npm install cookie_js --save 储存 cookie.set(‘key‘, ‘value‘); cookie.set(key1: ‘value1‘; key2: ‘value2‘); 获取 cookie.get(‘key‘); cookie.get(‘key1‘, ‘key2‘); 清除 cookie.remove(‘key‘); cookie.remove(‘key1‘, ‘key2‘); cookie.remove([ ‘key1‘, ‘key2‘ ]); 存储大小:5M,存储于客户端,而且只能存储字符串类型 存储 window.sessionStorage.setItem("key", "value"); 获取 window.sessionStorage.getItem("key"); 删除 window.sessionStorage.removeItem("key"); 清空 sessionStorage.clear(); 将sessionStorage换位localStorage即可 html session,local,cookie存储 标签:storage 获取 set 字符 客户 大小 val 临时 value 原文地址:https://www.cnblogs.com/rt8090/p/14707781.htmlcookie_js
HTML5本地存储
sessionStorage(临时性,关闭浏览器即清除
localStorage(长期性,手动删除
文章标题:html session,local,cookie存储
文章链接:http://soscw.com/index.php/essay/89210.html