After the Authorization request, the server redirects to the "/" application and sends the XSRF-TOKEN and laravel-session to the cookie.
Task: to transmit this Token in 'Params' with each subsequent request, after receiving it from the Cookie
How to do?
There is a cycle, for example:
app.controller('myCtrl', ['$http', '$scope', '$cookies', function($http, $scope, $state, $cookies) { $http({ method:'POST', url:'https://mysite/api/acc_details', params: { 'token': $cookies.csrftoken } }) Tried and ` config: $ http.defaults.headers.post ['X-CSRFToken'] = $ cookies.get ('csrftoken') ,
But in this case, the server will receive a header that it should read. and $ cookies.ge () constantly in the console gives an error that 'get' is not defined.