I want to know if, when I make a $.post(...) with jQuery, does any cookie is sent to the server in the post request?
Thanks!
I want to know if, when I make a $.post(...) with jQuery, does any cookie is sent to the server in the post request?
Thanks!
Without knowing for sure I'm going to say a big fat yes because I'm in that sort of mood!
To test it, post to a page which examines the request.
Cookies are sent with Ajax requests.
When the HTTPOnly flag is set for a cookie, this cookie is hidden from client-side scripts, but the cookie is still sent with Ajax requests.
Using the same cookies on the client and the server is not possible when you have httpOnlyCookies switched on. There is very good reason switch this on too:
Using Firefox+Firebug you can see exactly what jQuery sends, and how. Useful for debugging!