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/remote_callback_freer.cc
v8::Local<v8::Object> target,
                                 int object_id,
                                 content::WebContents* web_contents) {
  new RemoteCallbackFreer(isolate, target, object_id, web_contents);
}
RemoteCallbackFreer::RemoteCallbackFreer(v8::Isolate* isolate,
                                         v8::Local<v8::Object> target,
                                         int object_id,
                                         content::WebContents* web_contents)
    : ObjectLifeMonitor(isolate, target),
      content::WebContentsObserver(web_contents),
      object_id_(object_id) {}
RemoteCallbackFreer::~RemoteCallbackFreer() {}
void RemoteCallbackFreer::RunDestructor() {
  base::string16 channel =
      base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK");
  base::ListValue args;
  args.AppendInteger(object_id_);
  auto* frame_host = web_contents()->GetMainFrame();
  if (frame_host) {
    frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false,
                                              channel, args));
  }
  Observe(nullptr);
}
void RemoteCallbackFreer::RenderViewDeleted(content::RenderViewHost*) {
  delete this;
}
}