I want to know if, when I make a $.post(...) with jQuery, is any cookie sent to the server in the post request?
Thanks!
Basically, ajax request as well as synchronous request sends your document cookies automatically.
To send cookies to the server, you need to add the "Cookie: name=value" header to your request. To send multiple Cookies in one cookie header, you can separate them with semicolons. In this Send Cookies example, we are sending HTTP cookies to the ReqBin echo URL.
post() method loads data from the server using a HTTP POST request.
The data stored in the cookie is created by the server when it processes a request from the client. This data is tagged with an identifier that is unique to you and your computer. The browser sends cookies back to the server with each subsequent 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With