Currently, I am utilizing a Web RESTful API from my client within AngularJS.
app.controller('LoginController', [
'$http',
'$cookies',
function($http, $cookies) {
this.credentials = {};
this.http = $http;
this.login = function() {
console.log(this.credentials);
var authdata = btoa(
this.credentials.username +
':' +
this.credentials.password
);
$http.defaults.headers.common['Authorization'] = 'Basic ' + authdata;
console.log($http);
var res = $http.post("http://API_NAME/library");
res.success(function(data, status, header){
alert('Successfully executed function');
console.log($cookies.get('JSESSIONID'));
});
res.error(function(data, status, headers, config) {
console.log('Error Log');
});
};
},
]);
Next, there is the Http headers Response that follows:
Set-Cookie:JSESSIONID=azekazEXAMPLErezrzez; Path=/; HttpOnly
I am making use of ngCookies to acquire the JSESSIONID value and then manually creating it in my browser, but encountering difficulties accessing it.
Despite browsing through various posts on StackOverflow, I have found them to be either outdated or lacking clarity and solutions.
Thank you for your interest and assistance.