localStorage长期存储数据,浏览器关闭后数据不丢失; sessionStorage数据在浏览器关闭后自动删除。 转载于:https://www.cnblogs.com/luckyXcc/p/5843487.html