Fix reading of session/logout when using custom entities