I'm using a POST form to login on my backend which works without any problem. The backend accepts all locations (*)
After I login, I'm ready to get some data and then I get Cross-Origin-request blocked: the Same Origin Policy doesn't allow thebackend.test/Statistics/.stat (Reason: CORS-header ‘Access-Control-Allow-Origin’ doens't corrspond with ‘*’).
onLoginClick: function(buttons){
// this.onLoginSuccess(null,null);
// return;
var me = this;
var loginForm = this.lookupReference('loginForm');
loginForm.submit({
url: this.url,
scope: this,
success: me.onLoginSuccess,
failure: me.onLoginFailure,
waitMsg: 'Validating...'
});
},
onLoginSuccess: function (form, action) {
var me = this;
// destroy login window (form)
me.getView().destroy();
var check = Ext.Ajax.request({
url : 'http://thebackend.test/Statistics/.stat',
scope : this,
withCredentials: true,
useDefaultXhrHeader: false,
cors: true,
params: {
entity: 'EmployeePid',
action: 'lst'
},
failure : function(response) {
console.log('failure is hit');
},
success : function(response) {
}
});
console.log(check);
}, ...
However, when I use firefox POSTER and simulate the call everything works: no cross origin problems - using EXACTLY! the same parameters (verified with HttpFox):