javascript - The content obtained through document.cookie in js is incomplete
天蓬老师
天蓬老师 2017-05-19 10:40:18
0
4
660

The content obtained through document.cookie in js is incomplete!
You can see the complete cookie in the cookie in the browser's application, and individual fields cannot be obtained through document.cookie.
Is there any other way to obtain it? ?
image description

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
Ty80

The unreadable cookie content mentioned in the problem description should be set to HttpOnly, that is, the client script cannot read it and can only read and operate it from the server.

The purpose of setting HttpOnly is to prevent XSS attacks by preventing JS from reading Cookies.

Except through browser plug-ins (the browser provides an interface for it), it is basically impossible to use client-side scripts.

洪涛

Look at the back of the Cookies and there is http. The ones that cannot be obtained should be http only. The front end cannot obtain them and can only obtain and operate through http requests

Ty80

The cookie size is limited and differs between browsers. Now it is generally recommended to use localstorage

黄舟

Although HttpOnly cookies cannot be viewed using scripts, the chrome extension can be viewed.
After installing this plug-in: EditThisCookie
you can view all cookie contents, which is especially effective during testing.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template