private NewCookie createWsCookie(String cookieName,String token,boolean setMaxAge,String userAgent){
  String ieExpires="";
  int maxAge=setMaxAge ? _tokenManager.getMaxTokenLifeTimeInSecs() : NewCookie.DEFAULT_MAX_AGE;
  if (setMaxAge && StringUtils.contains(userAgent,"MSIE")) {
    ieExpires=";expires=" + getExpiredTimeGMT(maxAge);
    _log.debug("Expires: " + ieExpires);
  }
  if (token != null && !token.isEmpty()) {
    return new NewCookie(cookieName,token + ";HttpOnly" + ieExpires,null,null,null,maxAge,true);
  }
  return null;
}

private NewCookie createWsCookie ( String cookieName , String token , boolean setMaxAge , String userAgent ) { String ieExpires = "" ; int maxAge = setMaxAge ? _tokenManager . getMaxTokenLifeTimeInSecs ( ) : NewCookie . DEFAULT_MAX_AGE ; if ( setMaxAge && StringUtils . contains ( userAgent , "MSIE" ) ) { ieExpires = ";expires=" + getExpiredTimeGMT ( maxAge ) ; _log . debug ( "Expires: " + ieExpires ) ; } if ( token != null && ! token . isEmpty ( ) ) { return new NewCookie ( cookieName , token + ";HttpOnly" + ieExpires , null , null , null , maxAge , true ) ; } return null ; }
create and return a cookie object with the token
