if (!aCookie->isSession && nsInt64(aCookie->expires) < aCurrentTime) {
if (!aCookie->isSession && nsInt64(aCookie->expires) <= aCurrentTime) {
COOKIE_Add(cookie_CookieStruct *aCookie,           nsInt64             aCurrentTime,           nsIURI              *aHostURI,           const char          *aCookieHeader){  // find a position to insert the cookie at (and delete a cookie from, if necessary).  // also removes expired cookies from the list, for maintenance purposes.  PRInt32 insertPosition, deletePosition;  PRBool foundCookie = cookie_FindPosition(aCookie, insertPosition, deletePosition, aCurrentTime);  // store the cookie  if (foundCookie) {    cookie_CookieStruct *prevCookie;    prevCookie = NS_STATIC_CAST(cookie_CookieStruct*, sCookieList->ElementAt(insertPosition));    NS_ASSERTION(prevCookie, "corrupt cookie list");    delete prevCookie;    // check if the server wants to delete the cookie    if (!aCookie->isSession && nsInt64(aCookie->expires) < aCurrentTime) {      // delete previous cookie      sCookieList->RemoveElementAt(insertPosition);      COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "previously stored cookie was deleted");      sCookieChanged = PR_TRUE;      return NS_ERROR_FAILURE;    } else {      // replace previous cookie      sCookieList->ReplaceElementAt(aCookie, insertPosition);    }  } else {    // check if cookie has already expired    if (!aCookie->isSession && nsInt64(aCookie->expires) < aCurrentTime) {      COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "cookie has already expired");      return NS_ERROR_FAILURE;    }    // add the cookie, which means we might have to delete an old cookie    if (deletePosition != -1) {      cookie_CookieStruct *deleteCookie;      deleteCookie = NS_STATIC_CAST(cookie_CookieStruct*, sCookieList->ElementAt(deletePosition));      NS_ASSERTION(deleteCookie, "corrupt cookie list");      sCookieList->RemoveElementAt(deletePosition);      delete deleteCookie;      // adjust insertPosition if we removed a cookie before it      if (insertPosition > deletePosition) {        --insertPosition;      }    }    sCookieList->InsertElementAt(aCookie, insertPosition);  }  sCookieChanged = PR_TRUE;  return NS_OK;}