Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
CORS - Unable to logout from application

I am doing a proof of concept on AngularJS and SpringMVC 5.x, Tomcat and single-sign-on (SSO) to login and logout from the application. When session is timed-out or Invalid session, the application is not redirected to login page. I am getting CORS error message.

Here is the sample JavaScript code for Invalid Session and Session timeout, please help how to apply CORS on the below code.

//Invalid Session 
TestApp.factory('respInterceptor', function($location, $window, $cookies) {
return {
response: function(resp) {
//console.log(" Test : " + JSON.stringify(resp));
return resp;
},
responseError : function(error) {
console.log(" Error >>> : "+error.status )
if(error.status == 401 || error.status == 302) {
$cookies.JSESSIOINID = '';
console.log("invalid session");
window.location = "http://login.boshiftdev.com/app/ui/login.jsp";
}
}
};
})



//Session Timeout
$scope.logout = function() { $cookies.JSESSIOINID = '';
console.log("logout"); 
$http({
method: 'POST',
url: contextURL+'/logout',
headers: {'Content-Type': 'application/json'}, 
params: {data: $rootScope.userSession }
}).
success (function(data) {
$rootScope.userSession = null; $window.location = 'login.jsp';
window.location = ""
}).
error (function(data) {
$rootScope.userSession = null; $window.location= 'login.jsp';
console.error('');
});
}

CORS Error

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!