80
Views
5
Comments
Solved
Browser window is not closing automatically while clicking on logout button in.
Application Type
Traditional Web

Hi all,

I am trying to implement a scenario were user clicks on logout button then the browser window should automatically close.


2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Like I mentioned above, that is because of the limitations of the code. (For security reasons, so I don't expect there to be any other solutions.)

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Rajeshree,

I don't think that is possible.
You have the javascript function:

 window.close()

But that can only be used if that window/tab is the first one in that tab's / window's history
https://developer.mozilla.org/en-US/docs/Web/API/Window/close


2022-11-25 06-39-01
Rajeshree

Hi Eric,

Thank you for the information.

2025-04-17 05-42-16
Ajit Kurane

Hello Rajeshree,

Adding to the Eric answer,

You can implement above script like this,

Hope it helps you.

Regards,

Ajit Kurane.


2022-11-25 06-39-01
Rajeshree

Hi Ajit,

Thank you for your suggestion, I have used the same approach but only the window that is opening by default  is closing but when I am going to any other Screen  it is not working.  

2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Like I mentioned above, that is because of the limitations of the code. (For security reasons, so I don't expect there to be any other solutions.)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.