JayyCodez JayyCodez - 3 days ago 4
Vb.net Question

Using a If statement to validate who has logged in. Account type

I am needing to check if one of two session vars are true or false. If one or both are true then run if both are false don't run. Rather simple I am just seeming to have issues. I just runs the logout routine when both are true.

If Not Session("studentLoggedIn") Or Session("adminLoggedIn") Then
Routines.LogOut()
End If

Answer

Just add some parenthesis:

If Not (Session("studentLoggedIn") Or Session("adminLoggedIn")) Then
    Routines.LogOut()
End If