nsresult rv = os->NotifyObservers(nsnull, "cookieIcon", NS_ConvertASCIItoUCS2("on").get());
nsresult rv = os->NotifyObservers(nsnull, "cookieIcon", NS_LITERAL_STRING("on").get());
COOKIE_SetCookieStringFromHttp(nsIURI * curURL, nsIURI * firstURL, nsIPrompt *aPrompter,  const char * setCookieHeader, char * server_date, nsIHttpChannel* aHttpChannel) {#ifdef DEBUG_morse//   printf("... curURL=%s\n",curURL);//   printf("... 1stURL=%s\n",firstURL);#endif  /* allow for multiple cookies separated by newlines */   char *newline = PL_strchr(setCookieHeader, '\n');   if(newline) {     *newline = '\0';     COOKIE_SetCookieStringFromHttp(curURL, firstURL, aPrompter, setCookieHeader, server_date, aHttpChannel);     *newline = '\n';     COOKIE_SetCookieStringFromHttp(curURL, firstURL, aPrompter, newline+1, server_date, aHttpChannel);     return;   }  /* If the outputFormat is not PRESENT (the url is not going to the screen), and not   *  SAVE AS (shift-click) then    *  the cookie being set is defined as inline so we need to do what the user wants us   *  to based on his preference to deal with foreign cookies. If it's not inline, just set   *  the cookie.   */  char *ptr=nsnull;  time_t gmtCookieExpires=0, expires=0, sDate;  /* check to see if P3P pref is satisfied */  nsCookieStatus status = nsICookie::STATUS_UNKNOWN;  if (cookie_GetBehaviorPref() == PERMISSION_P3P) {    status = cookie_P3PDecision(curURL, firstURL, aHttpChannel);    if (status == nsICookie::STATUS_REJECTED) {      nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));      if (os) {        nsresult rv = os->NotifyObservers(nsnull, "cookieIcon", NS_ConvertASCIItoUCS2("on").get());      }      return;    }  }   /* check for foreign cookie if pref says to reject such */  if ((cookie_GetBehaviorPref() == PERMISSION_DontAcceptForeign) &&      cookie_isForeign(curURL, firstURL)) {    /* it's a foreign cookie so don't set the cookie */    return;  }  /* check if a Mail/News message is setting the cookie */  if (cookie_GetDisableCookieForMailNewsPref() && cookie_isFromMailNews(firstURL))    return;  /* Determine when the cookie should expire. This is done by taking the difference between    * the server time and the time the server wants the cookie to expire, and adding that    * difference to the client time. This localizes the client time regardless of whether or   * not the TZ environment variable was set on the client.   */  /* Get the time the cookie is supposed to expire according to the expires attribute*/  ptr = PL_strcasestr(setCookieHeader, "expires=");  if(ptr) {    char *date =  ptr+8;    char origLast = '\0';    for(ptr=date; *ptr != '\0'; ptr++) {      if(*ptr == ';') {        origLast = ';';        *ptr = '\0';        break;      }    }    expires = cookie_ParseDate(date);    *ptr=origLast;  }  if (server_date && *server_date) {    sDate = cookie_ParseDate(server_date);  } else {    sDate = get_current_time();  }  if( sDate && expires ) {    if( expires < sDate ) {      gmtCookieExpires=1;    } else {      gmtCookieExpires = expires - sDate + get_current_time();      // if overflow       if( gmtCookieExpires < get_current_time()) {        gmtCookieExpires = MAX_EXPIRE; // max int      }    }  }  /* If max-age attribute is present, it overrides expires attribute */#define MAXAGE "max-age="  ptr = PL_strcasestr(setCookieHeader, MAXAGE);  if(ptr) {    ptr += PL_strlen(MAXAGE);    time_t delta = atoi(ptr);    if (delta == 0) {      gmtCookieExpires = 1; // force cookie to expire immediately    } else if (delta > 0) { // negative max-age is not allowed -- see rfc 2109      gmtCookieExpires = get_current_time() + delta;    }  }  cookie_SetCookieString(curURL, aPrompter, setCookieHeader, gmtCookieExpires,                         aHttpChannel, status);}