JQuery $ .cookie does not read cookie set by server response

$. cookie does not read cookies that were previously set by the server response.

I can read cookies that were set with $ .cookie ().

I see that all domain cookies set in Firefox Web Developer are being added.
In addition, the server side can see request cookies, so the browser definitely has them.

I experimented with expiration time to no avail.

+5
source share
2 answers

The problem is that the server side is sending cookies with the HttpOnly setting, as described here: http://en.wikipedia.org/w/index.php?title=HTTP_cookie#HttpOnly_cookie

Cookies, , document.cookie. , cookie XSS .

: , , cookie. PHP, HttpOnly:

https://www.owasp.org/index.php/HttpOnly#Using_PHP_to_set_HttpOnly

+6

UPDATE: (. ). , . , - . , cookie javascript, cookie. , cookie "/", cookie "/mypages" .

$. cookie cookie , , a > mysite.com/mypages/mypage.aspx, "/" cookie, $.cookie "/mypages" cookie. . , , .

+1

All Articles