I have a menu item to log out and transfer the page. Sometimes when tapping that, the user accidentally taps the GoogleMap behind it, and its mapclick event fires (and crashes because curUser = Nothing)
While I added a check in the Mapclick event to make sure the MainPage was the current form, I feel like after setting a MainPage, other event handlers on the form should stop firing, because we are leaving. Is this intended behavior? thanks
Private Sub btnLogOut_Click(sender As Object, e As EventArgs) Handles mnuLogOut.Click
CookieHelper.DeleteCredentialCookies() ‘Clear login credentials from cookie.
Application.Session(“user”) = Nothing ‘Clear user variable (in Session)
Me.curUser = Nothing ‘Clear user variable (on form)
Application.Session.IsLoggedOn = False ‘Change Logged on to false
Application.MainPage = New frmLogin ‘Navigate to frmLogin
Please login first to submit.