Cookie Object
is a kind of data information (Cookie data) saved in the Cookies folder of the client's hard disk in the form of a file (Cookie file). User data information in the cookie folder (Cookie data). The cookie file is created by the visited Web site to permanently save the session data between the client and the Web site, and the cookie data is only allowed to be read by the visited Web site. (Cross-domain access is not allowed)
Cookie file format:
NS:Cookie.txt
IE: username@domain name.txt
Javascript writes to Cookie
Format:
document.cookie="keyword=value[;expires=valid date][;…]"
Note:
Valid date format: Wdy,DD-Mon-YY HH:MM: SS
Wdy/Mon: English week/month;
Also contains path, domain, secure attributes;
Each website (domain) can create 20 cookie data;
Each browser can store 300 cookie data, 4K bytes;
The customer has disabled the writing of cookie data.
It is much more troublesome to use js to operate cookies than to use jsp servlet to operate cookies
Why can’t I see the cookie file used to store Session in the Cookie folder?
Use two types of cookies
Persistent cookies will be stored on the client's hard drive.
Session Cookie: It is not stored on the client's hard disk, but is placed in the memory of the browser process. When the browser is closed, the session Cookie is destroyed.