I have a function that is called several times in a loop that is trying to access cookies, but after few times i get the following error:

Electron: 1.4.11

Cannot get property 'cookies' on missing remote object 16127
Error: Cannot get property 'cookies' on missing remote object 16127
    at throwRPCError (D:\devel\work\js\microstockr.desktop\node_modules\electron-prebuilt\dist\resources\electron.asar\browser\rpc-server.js:143:17)
    at EventEmitter.<anonymous> (D:\devel\work\js\microstockr.desktop\node_modules\electron-prebuilt\dist\resources\electron.asar\browser\rpc-server.js:368:7)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)
    at WebContents.<anonymous> (D:\devel\work\js\microstockr.desktop\node_modules\electron-prebuilt\dist\resources\electron.asar\browser\api\web-contents.js:231:13)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)

The code is:
var session = require('electron').remote.session;
session.defaultSession.cookies.get({ url: url }, function(err, domainCookies) {.....});

atom/common/api/atom_api_v8_util.cc
isolate->RequestGarbageCollectionForTesting(
      v8::Isolate::GarbageCollectionType::kFullGarbageCollection);
}
bool IsSameOrigin(const GURL& l, const GURL& r) {
  return url::Origin::Create(l).IsSameOriginWith(url::Origin::Create(r));
}
void Initialize(v8::Local<v8::Object> exports,
                v8::Local<v8::Value> unused,
                v8::Local<v8::Context> context,
                void* priv) {
  mate::Dictionary dict(context->GetIsolate(), exports);
  dict.SetMethod("getHiddenValue", &GetHiddenValue);
  dict.SetMethod("setHiddenValue", &SetHiddenValue);
  dict.SetMethod("deleteHiddenValue", &DeleteHiddenValue);
  dict.SetMethod("getObjectHash", &GetObjectHash);
  dict.SetMethod("takeHeapSnapshot", &TakeHeapSnapshot);
  dict.SetMethod("setRemoteCallbackFreer", &atom::RemoteCallbackFreer::BindTo);
  dict.SetMethod("setRemoteObjectFreer", &atom::RemoteObjectFreer::BindTo);
  dict.SetMethod("createIDWeakMap", &atom::api::KeyWeakMap<int32_t>::Create);
  dict.SetMethod("createDoubleIDWeakMap",
                 &atom::api::KeyWeakMap<std::pair<int64_t, int32_t>>::Create);
  dict.SetMethod("requestGarbageCollectionForTesting",
                 &RequestGarbageCollectionForTesting);
  dict.SetMethod("isSameOrigin", &IsSameOrigin);
}
}  
NODE_BUILTIN_MODULE_CONTEXT_AWARE(atom_common_v8_util, Initialize)