cookie, seesion, storage, indexDB

cookie, seesion, storage, indexDB

http do not have state

1.Cookie 4k, could set expires and max-time

usage: http header || document.cookie

maintain user page’s state
(Store user’s info in browser but too small, not secure)

2.Localstorage 5m, long time

usage: window
Store user’s info in browser, ex…username

Required same domain port protocol

3.Sessionstorage, short time

Store temporary info in browser

Required same window.

4.indexDB 250m

usage: window
Store huge info in browser, non-relational DB

reference

https://www.cnblogs.com/fundebug/p/about-browser-storage.html

上一篇:selenium+browser爬虫


下一篇:「数据分析师的数据爬虫」简单的模拟登录方法