{
    assert_unreached('Invalid credentials option was specified: ' +
                      options.credentials);
  }
  if (options.type !== 'classic' && options.type !== 'module')
    assert_unreached('Invalid type option was specified: ' + options.type);

  if (options.type === 'classic')
    return (config.origin === 'same') ? '1' : '';

  if (options.credentials === 'omit')
    return '';
  else if (options.credentials === 'include')
    return '1';
  else
    return (config.origin === 'same') ? '1' : '