$http doesn't send cookie in Requests $http doesn't send cookie in Requests angularjs angularjs

$http doesn't send cookie in Requests


In your config, DI $httpProvider and then set withCredentials to true:

.config(function ($httpProvider) {    $httpProvider.defaults.withCredentials = true;    //rest of route code})

Info on angularjs withCredentials: http://docs.angularjs.org/api/ng.$http

Which links to the mozilla article: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS?redirectlocale=en-US&redirectslug=HTTP_access_control#section_5


$http.get("URL", { withCredentials: true })  .success(function(data, status, headers, config) {})  .error(function(data, status, headers, config) {});

Another thing to keep in mind: You need to have 3rd party cookies enabled. If you have it globally disabled in Chrome, click on the "i"-Symbol to the left of the domain name, then cookies, then "blocked" and unblock the target domain.