$.Cookie () is undefined. What's going on?

Project environment localhost:8080
process: log in to the callback interface and write it to the token environment with $.cookie (the value obtained by "token",). Take it with $.cookie (" token") on another page, but it"s always undefined. I checked a lot of documents on the Internet. But I use document.cookie to output directly in the console, which can be exported, and then I use a method to output the token in cookie, which can also be output in the console, which is undefined.

in the page js.

clipboard.png

clipboard.png
js
clipboard.png

clipboard.png
at first I thought it was an environmental problem. I asked the background if there was anything set up, but the background said it was useless. It is also localhost. There is no problem with normal access to my last project


another page is fetched with $.cookie ('token'), but it is always undefined.

is basically an expired cookie .
Open the developer tool, select Application , select the cookie you want to read, and check Expires .


has been resolved, and the path structure of the mysql data table has been changed to cause cross-domain.
in fact, it's not much of a problem to take $cookie. It's just that I didn't know to change the path at that time, and debug was a little skeptical about life

.
Menu