* 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.h
SUCCESS,
    FAILED,
  };
  using GetCallback = base::Callback<void(Error, const net::CookieList&)>;
  using SetCallback = base::Callback<void(Error)>;
  static mate::Handle<Cookies> Create(v8::Isolate* isolate,
                                      AtomBrowserContext* browser_context);
  
  static void BuildPrototype(v8::Isolate* isolate,
                             v8::Local<v8::FunctionTemplate> prototype);
 protected:
  Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context);
  ~Cookies() override;
  void Get(const base::DictionaryValue& filter, const GetCallback& callback);
  void Remove(const GURL& url, const std::string& name,
              const base::Closure& callback);
  void Set(const base::DictionaryValue& details, const SetCallback& callback);
  
  void OnCookieChanged(const net::CanonicalCookie& cookie,
                       bool removed,
                       net::CookieStore::ChangeCause cause) override;
 private:
  net::URLRequestContextGetter* request_context_getter_;
  scoped_refptr<AtomCookieDelegate> cookie_delegate_;
  DISALLOW_COPY_AND_ASSIGN(Cookies);
};
}  
}  
#endif