Fix NPE when no default domain is defined for an user.
Remove session id references.