# AuthSessionsResource

Canonical page: https://docs.ovok.com/java-sdk/reference/auth-sessions-resource

```java
public final class AuthSessionsResource
```

Lists and revokes the signed-in user's sessions. Get it from [`AuthResource.sessions()`](/java-sdk/reference/auth-resource#sessions).

## Methods [#methods]

### list [#list]

```java
public List<JsonNode> list() throws IOException, InterruptedException
```

Lists the user's sessions (`GET /auth/session`).

**Returns:** the sessions; empty when the response is not a list

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### revoke [#revoke]

```java
public void revoke(String sessionId) throws IOException, InterruptedException
```

Revokes a session (`DELETE /auth/session/{sessionId}`). Revoking `current` also ends the local session.

**Parameters:**

- `sessionId`: the session ID, or `current`

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response
