# logout

This method is to log out from Cortex. You can use the method [getUserLogin](https://emotiv.gitbook.io/cortex-api/authentication/getuserlogin) to know if a user is already logged in or not.

## Parameters

| Name     | Type     | Required | Description                        |
| -------- | -------- | -------- | ---------------------------------- |
| username | `string` | yes      | The EMOTIV ID of the current user. |

## Result

The result is an object with these fields:

| Name     | Type     | Description    |
| -------- | -------- | -------------- |
| username | `string` | The EMOTIV ID. |
| message  | `string` |                |

## Example

{% tabs %}
{% tab title="Request" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "logout",
  "params": {
    "username": "jon.snow"
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "message": "User jon.snow logout successfully",
    "username": "jon.snow"
  }
}
```

{% endtab %}
{% endtabs %}
