<!--
{
  "availability" : [
    "iOS: 9.0.0 - 26.0.0",
    "iPadOS: 9.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEHotspotHelper/logoff(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEHotspotHelper(cm)logoff:"
  },
  "title" : "logoff(_:)"
}
-->

# logoff(_:)

Terminate the authentication session for a Hotspot network.

```
class func logoff(_ network: NEHotspotNetwork) -> Bool
```

## Parameters

`network`

A [`NEHotspotNetwork`](/documentation/NetworkExtension/NEHotspotNetwork) corresponding to the currently associated Wi-Fi network.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the logoff command was successfully queued, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

The application invokes this method when it wants to log off from the current network. Invoking this method causes an [`NEHotspotHelperCommand`](/documentation/NetworkExtension/NEHotspotHelperCommand) of type [`NEHotspotHelperCommandType.logoff`](/documentation/NetworkExtension/NEHotspotHelperCommandType/logoff) to be issued to the application’s ‘handler’ block, which is registered with the system by calling `NEHotspotHelper registerWithOptions:queue:handler`.

The `network` parameter must correspond to the currently associated Wi-Fi network i.e. it must have come from the `network` property of the [`NEHotspotHelperCommand`](/documentation/NetworkExtension/NEHotspotHelperCommand) or from the `supportedInterfaces` method.

> Warning:
> The application must not actually log off from the network until it receives the command to log off.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)