How to stop running the code if the user made a specific action

@y-dorey

  1. I don;'t understand why you put “Website Redirect” in the lightbox.close() call.

  2. This part (on the masterPage ) in not clear:

    $w("#button6").onClick(function() {
        session.setItem("userConfirm", true)
        wixWindow.lightbox.close("Website Redirect");
    }

Button 6 is on the lightbox and the event handler should opnly be in the lightbox code.
3. You should set the session item in the lightbox code.
4. it should be session.setItem(“userConfirm”, “true”);
5. masertPage: It should be if(!userConfirm){