Now the user presses a button with the mouse. The button action fires and we use "webpage2.show" to switch to other page. As you see the second page is created with open event firing and resized. Than first page hides, before second page is shown.
When the user closes the browser window, nothing happens until a timeout after which the session is destroyed. So you see the webpages get their Close events including all the controls on them. The session is also closed and destructor fires. Finally also the destructors of the webpages fire. And on the end, when the web app quits, the app.close event is called.
Important note: Webpages are not released from memory before the session closes.
Sample project: livecycle.rbp.zip