B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * Restores cookies
   * @param aCookies
   *        Array of cookie objects
   */
Restores cookies
@param aCookies
Array of cookie objects
Restores cookies @param aCookies Array of cookie objects
function ssi_restoreCookies(aCookies) {
    var MAX_EXPIRY = Math.pow(2, 62);
    for (let i = 0; i < aCookies.length; i++) {
      var cookie = aCookies[i];
      try {
        Services.cookies.add(cookie.host, cookie.path || "", cookie.name || "",
                             cookie.value, !!cookie.secure, !!cookie.httponly, true,
                             "expiry" in cookie ? cookie.expiry : MAX_EXPIRY);
      }
      catch (ex) { Cu.reportError(ex); } 
    }
  }
function ssi_restoreCookies ( aCookies ) { var MAX_EXPIRY = Math . pow ( 2 , 62 ) ; for ( let i = 0 ; i < aCookies . length ; i ++ ) { var cookie = aCookies [ i ] ; try { Services . cookies . add ( cookie . host , cookie . path || "" , cookie . name || "" , cookie . value , ! ! cookie . secure , ! ! cookie . httponly , true , "expiry" in cookie ? cookie . expiry : MAX_EXPIRY ) ; } catch ( ex ) { Cu . reportError ( ex ) ; } } }
Restores cookies
 @param aCookies
        Array of cookie objects
Restores cookies @param aCookies Array of cookie objects
// MAX_EXPIRY should be 2^63-1, but JavaScript can't handle that precision // don't let a single cookie stop recovering