pub fn write_to_disk(cookie: &Cookie, dir: &Path) -> Result<()>
Writes the given cookie to the given dir.
Uses restrictive file permissions (0600 on Unix) to prevent other local users from reading the cookie secret.