- Electron version: 1.2.2, and 1.3.1 (I only tested the 2 versions)
- Operating system: Windows 10

steps:

1.　Register a  custom protocol **`"app"`** by `protocol.registerFileProtocol`

```
    protocol.registerStandardSchemes(['app']);
    app.on('ready', function(){
        protocol.registerFileProtocol('app', (request, callback) => {
            //.......
        });
        //.......
    });
```

2.　call `cookies.set` for **`app://myhost/`**

```
    session.defaultSession.cookies.set({
            url : 'app://myhost/',      //custom protocol
            name : 'test',
            value : '12345'
        },
        (error)=>{
            if(error){
                console.log(error);  //error occurred here
            }
        }
    );
```

With url of custom protocol, an error will occur.  

If using standard http protocol, the code works well.

```
    session.defaultSession.cookies.set({
            url : 'http://otherhost/',     //standard http protocol
            name : 'test',
            value : '12345'
        },
        (error)=>{  //works well, no error
            if(error){
                console.log(error);
            }
        }
    );
```

atom/browser/api/atom_api_protocol.cc
const std::vector<std::string>& schemes, mate::Arguments* args) {
  if (atom::Browser::Get()->is_ready()) {
    args->ThrowError("protocol.registerStandardSchemes should be called before "
                     "app is ready");
    return;
  }
  auto policy = content::ChildProcessSecurityPolicy::GetInstance();
  for (const auto& scheme : schemes) {
    url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT);
    policy->RegisterWebSafeScheme(scheme);
  }
  auto command_line = base::CommandLine::ForCurrentProcess();
  command_line->AppendSwitchASCII(atom::switches::kStandardSchemes,
                                  base::JoinString(schemes, ","));
}
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                v8::Local<v8::Context> context, void* priv) {
  v8::Isolate* isolate = context->GetIsolate();
  mate::Dictionary dict(isolate, exports);
  dict.SetMethod("registerStandardSchemes", &RegisterStandardSchemes);
}
}  
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_protocol, Initialize)