Prevent Cookies From Being Sent on AJAX Request
- by user340571
Hello everyone,
I have a web service that I invoke from script but that does not need any information stored in cookies. Anytime I make a request to the service, the cookie is sent along with it. I understand that by default cookies are sent with HTTP request, but is there any way at all to overwrite that behavior and not send the cookie?
In a nutshell, I am issuing my request like this:
$.ajax({
type: "POST",
cache: false,
url: url,
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) { successFunc(response); },
error: function(xhr) { errorFunc(xhr); }
});