BISERVER-9147 - IE8 - Error received after login, cannot proceed.
Replaced use of  lastIndexOf by a for, because IE8 doesn't have lastIndexOf or indexOf.