I have a phonegap application that communicates with a server using ajax and cookies for session managment.
I need to access the cookies in the client side. I've tried:
document.cookie;
However, this results in an empty string.
I know that the cookies are set, because the server that the client communicates with can see them.
At first I thought that it is empty because I access document.cookie from a different js file, but even from the same file that makes the ajax request I get an empty string.
Through Chrome's Resources->cookies->localhost I see that the cookies actually exist.
I checked over the server whether the HttpOnly flag is set to true, but it isn't.
Any ideas?
Thanks!
Edit:
I found this plugin:
https://github.com/carhartl/jquery-cookie
However, this results in an empty string as well.