I have a feeling I'm missing something simple but I just can't wrap my finger around the solution. Hopefully somebody here will be able to help.
From a page, I’m opening another window with JavaScript; this launches my PHP program. The program is a simple wizard with a NEXT, BACK, and CANCEL buttons. The wizard itself is a Object with NextButton(), BackButton(), and CancelButton(); the Object is saved in a session to be moved between pages. When I click on the CANCEL button, the page reloads and through the Objects CancelButton function and calls a JavaScript confirm() and window.close().
My problem is, when I attempt to re-launch the Wizard program, the session is still around causing all object variables to be reloaded. I would like the Wizard to start “Fresh”. I thought that if a window was closed the session would be automatically destroyed, but it doesn’t work. I thought that I could call __destruct() and destroy the session there but it does not get activated when the window is closed.
One solution is to destroy the session in the CancelButton function, but if the user cancels the confirm(), the object is still destroyed.
Any suggestions?