* Electron version: 1.4.14
* Operating system: Windows

Hi!
I faced with issue described in this two comments: 
https://github.com/electron/electron/issues/6388#issuecomment-236498471
https://github.com/electron/electron/issues/6388#issuecomment-244483403
The main issue is fixed, but the session is lost if the app is closed immediately after login and setting the cookie.

### Expected behavior
Cookie should be saved.

### Actual behavior
When the app is closed after less then 10-15 seconds a cookie is set, it is not saved when the app is reopened. 

atom/browser/api/atom_api_cookies.cc
const SetCallback& callback) {
  std::unique_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
  auto getter = make_scoped_refptr(request_context_getter_);
  content::BrowserThread::PostTask(
      BrowserThread::IO, FROM_HERE,
      base::Bind(SetCookieOnIO, getter, Passed(&copied), callback));
}
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
                              bool removed,
                              net::CookieStore::ChangeCause cause) {
  Emit("changed", cookie, cause, removed);
}
mate::Handle<Cookies> Cookies::Create(
    v8::Isolate* isolate,
    AtomBrowserContext* browser_context) {
  return mate::CreateHandle(isolate, new Cookies(isolate, browser_context));
}
void Cookies::BuildPrototype(v8::Isolate* isolate,
                             v8::Local<v8::FunctionTemplate> prototype) {
  prototype->SetClassName(mate::StringToV8(isolate, "Cookies"));
  mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
      .SetMethod("get", &Cookies::Get)
      .SetMethod("remove", &Cookies::Remove)
      .SetMethod("set", &Cookies::Set);
}
}  
}