question: private String resetPreferredIDPCookie ( String existingCookieValue , String toAddCookieValue , boolean bIsSAML2 ) { StringBuffer returnCookie = new StringBuffer ( ) ; String encodedCookieToAdd = Base64 . encode ( generateSuccinctID ( toAddCookieValue , bIsSAML2 ) ) ; StringTokenizer st = new StringTokenizer ( existingCookieValue , IDPDiscoveryConstants . PREFERRED_COOKIE_SEPERATOR ) ; while ( st . hasMoreTokens ( ) ) { String curIdpString = ( String ) st . nextToken ( ) ; if ( curIdpString . equals ( encodedCookieToAdd ) ) { continue ; } else { returnCookie . append ( curIdpString + " " ) ; } } returnCookie . append ( encodedCookieToAdd ) ; return returnCookie . toString ( ) ; }
target:  This function is used to reset the preferred IDP cookie based on the present value and the providerId of the IDP that calls this service