Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

We have some internal app , in mvc trying to implement Sign Out functionality but not working properly, for time being we are closing the browser but window.close is not working for chrome and Mozilla , please help.


Kind Regards .

Ajit Kumar Das
Posted

1 solution

Mozilla explicitly that you cannot close a window with script that wasn't opened with script[^].

Chrome is version dependent, but some hacks can close the window. It's a 20% option, though, so rather than do that pick a method that will work for all browsers.

Your better option IMO is to clear the cookie and redirect to another site; if you have an internal landing page that's a good choice.

There's a solid example of how to quickly and easily blow your cookies up here.[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900