Correct approach to check if user is logged in