After running a PHP script, the following response is returned:
{"result": "0", "token":"atoken" }
To execute the script with Angular, the following code is used:
$http.post( API["R001"], $scope.user, {}).then($scope.postSuccess, null);
Upon successful execution, the response is processed using this code:
$scope.postSuccess = function(response) {
if(response.data.result == "0") {
console.log(response.data.token);
$cookies.putObject("token", response.data.token, {'path':'/'} );
return;
} ...
An issue arises as the cookie value stored includes double quotes:
%22atoken%22
The problem results in the cookies retaining the quotation marks while console.log() displays the value without them.