Hi,
I set a cookie with expiration time (30 minutes). I created logout function to remove the cookie if the user would like to logout from the system. Everything is working fine till I am not closing and reopening the page. In this case when I try to logout than I am getting "Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development." error. The cookies.remove deleted the cookie but the page throws the above mentioned error. I commented out cookies.remove line and the error was gone so I think this is causing this issue.
This is my code which handle the remove call:
return result.then((result) => {
if (result.status === 'SUCCESS') {
cookies.remove('Session',{ path: '/'});
} else {
this.SweetAlert.Message(result, 'warning');
}
}).catch((error) => {
this.SweetAlert.Message(error, 'warning');
});
I would appreciate any help to fix this.
Hi, I set a cookie with expiration time (30 minutes). I created logout function to remove the cookie if the user would like to logout from the system. Everything is working fine till I am not closing and reopening the page. In this case when I try to logout than I am getting "Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development." error. The cookies.remove deleted the cookie but the page throws the above mentioned error. I commented out cookies.remove line and the error was gone so I think this is causing this issue. This is my code which handle the remove call: return result.then((result) => { if (result.status === 'SUCCESS') { cookies.remove('Session',{ path: '/'}); } else { this.SweetAlert.Message(result, 'warning'); } }).catch((error) => { this.SweetAlert.Message(error, 'warning'); }); I would appreciate any help to fix this.