Moved conditional logic for webseal users

Created a util class for Webseal users since this logic is also needed in
the Session listener.