<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorConfiguration/cookieAuthentication",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ConfigurationV20cookieAuthenticationSbvp"
  },
  "title" : "cookieAuthentication"
}
-->

# cookieAuthentication

Request Tor to bind a cookie-authenticated control port.

```
var cookieAuthentication: Bool
```

## Discussion

Maps to torrc `CookieAuthentication` (tor.1.txt). **Not normally
needed** for embedded deployments: swift-tor uses
`tor_main_configuration_setup_control_socket()` to obtain a
pre-authenticated control socket, which bypasses cookie/password
auth entirely. Set this only when exposing an external control
port over TCP.

Defaults to `false`. See control-spec.txt §3.5 for the cookie
authentication handshake.