I have a phonegap application that communicates with the server using ajax and session management cookies.
I need to access cookies on the client side. I tried:
document.cookie;
However, this results in an empty string.
I know that cookies are set because the server the client is interacting with can see them.
At first, I thought it was empty, because I access the document.cookie from another js file, but even from the same file that the ajax request makes, I get an empty line.
Via Chrome resources β cookies-> localhost I can see that cookies actually exist.
I checked the server whether the HttpOnly flag is set to true, but it is not.
Any ideas?
Thanks!
Edit:
I found this plugin:
https://github.com/carhartl/jquery-cookie
However, this also results in an empty string.
source share