I am developing a web-application using AngularJS.
The application is realized with:
- a frontend, a component without logic, that simply queries a backend many times, in order to receive from it all the needed data;
- a backend, containing many RESTful services, and each of them returns data to the frontend (if the frontend calls it).
In my frontend, in the main controller, I create a cookie using $cookieStore, in this way:
// Setting sessionID in the cookie
$cookieStore.put('sessionID', $scope.contextData.sessionId);
Now, I want to send the information of this cookie to the generic backend service that I call. For example, one of my call has this form:
$http({
method: "GET",
url: urlBase + "/context/person"
}).success(function(result, status, headers, config) {
$scope.currentPerson = result;
});
How can I send the cookie? Thanks in advance.