Electron Parent Child Window Communication

in my app main window is created in the main.js as every other app. And i created a few windows in another file named server.js. My problem is the following
when i tried logout the child windows opened are not closing

when i closed the main window the child windows are not closing
how can i close the child window while logout and closing the main window ?

how can i connect parent(main window) with the child windows, i reached to electron browser window section but it is digestible for me can anyone guide me ?

is there any way to call the child windows in main process from render.js file