# Offline support

Once the app [authenticates](https://emotiv.gitbook.io/cortex-api/authentication/authorize) with the Cortex successfully, it can use the Cortex token to stay offline while working with Cortex for a period of time (see soft limit, hard limit below).

Here is the recommended flow to work offline with Cortex:

**Step 1:** Follow [this API flow ](https://emotiv.gitbook.io/cortex-api/overview-of-api-flow)to get Cortex token the first time. This flow requires the Internet connection. A Cortex token will be available for 48 hours.

**Step 2:** When the Cortex token is expired, call [generateNewToken](https://emotiv.gitbook.io/cortex-api/authentication/generatenewtoken) API to generate another token. This API doesn't require the Internet connection.

**Step 3**: Check soft limit, hard limit of the current license via [getLicenseInfo](https://emotiv.gitbook.io/cortex-api/authentication/getlicenseinfo) API and warn the users to be online.

&#x20;In the license information, there are 2 fields "softLimitTime" and "hardLimitTime".

### softLimitTime

This is the reasonable time to warn users that the app will not be able to use offline soon. The app can still work offline until **hardLimitTime**.

### hardLimitTime

This is the time that the app will be no longer to use offline. The app must call [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize) API with the Internet connection to be able to continue working with Cortex.

{% hint style="info" %}
The **softLimitTime** will be at least 1 month later from the time the app calls [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize) API. The **hardLimitTime** is 7 days after **softLimitTime**.
{% endhint %}
