0

When i send a HTTP GET via ajax, does it includes propers cookies? or cookies goes in the request only when Method is POST?

Leonardo
  • 8,477
  • 8
  • 47
  • 119

2 Answers2

1

A get request should send cookies.

but
AJAX calls only send Cookies if the url you're calling is on the same domain as your calling script.

Read more in this SO answer

notice
localhost:3000 and localhost:3001 is not the same domain and treated as cross domain, so no cookies will be sent. (source)

Community
  • 1
  • 1
aludvigsen
  • 5,278
  • 2
  • 23
  • 33
0

It should send cookies with either type of request, just like the browser does when following links or submitting a form.

Barmar
  • 596,455
  • 48
  • 393
  • 495