Operating an ASP.NET Web application, I have a Logout feature implemented in JavaScript. However, my current code closes the browser upon Logout, which is not the desired behavior. Instead, I am looking to clear cookies/session and redirect the user to the login page, similar to a Login pop up example shown here Like this Login pop up. Moreover, it should work consistently across all major browsers such as Chrome, Internet Explorer, and Firefox. Unfortunately, the existing code does not function properly on Chrome. Can someone assist me in resolving this issue?
function Logout() {
if (confirm('Are you sure you want to close the browser?')) {
open(location, '_self').close();
} else {
// Do nothing!
}
}