A session is the link between your application and a headset.
You must create a session before you call subscribe to receive data from a headset. See createSession.
A session object includes these fields:
Name
Type
Description
id
string
The id of this session.
status
string
Can be "opened", "activated", or "closed".
owner
string
The EmotivID of the user.
license
string
The id of the license used by this session. Or an empty string if the session wasn't activated.
appId
string
The application id of your Cortex app.
started
string (ISO datetime)
When this session was created.
stopped
string (ISO datetime)
When this session was closed.
streams
array of strings
recordIds
array of strings
recording
boolean
True if a record is currently in progress for this session. False otherwise.
headset
object
The status is linked to the license. If the session is activated, it will be debited from the quota of the user's license.
Status
Description
opened
activated
closed
This session is closed, you cannot use it anymore.
A session with an Epoc+ headset. It is not activated. We subscribed to the performance metrics and motion data.
This method returns the list of the sessions created by the current application. You can create a session with .
New in 2.0: Sessions are now temporary in-memory objects. So this methods only returns the current sessions, not your past sessions. See for details.
The result is an array of .
This method is to open a session with an EMOTIV headset.
To open a session with a headset, the status of the headset must be "connected". If the status is "discovered", then you must call to connect the headset. You cannot open a session with a headset connected by a USB cable. You can use to check the status and connection type of the headset.
You can use to activate or close a session.
See for details.
Make sure the headset has the status "connected" before you call this method. Use to check the status of the headset.
If the status is "open", then the session won't be activated. You can activate the session later by calling .
The result is a representing the created session.
Open a session.
Open a session and activate it.
A session is an object that makes the link between your application and an EMOTIV headset. When the user wants to work with a headset, your application should create a session first. Then you can:
subscribe to the of the headset
create a and add
use
Your application can open only one session at a time with a given headset. But it can open multiple sessions with multiple headsets.
A session is created by and closed by .
A session is linked to an application. All the sessions of an application are automatically closed when the application is disconnected from the Cortex service. A session is also closed if the headset is disconnected.
A session is a temporary in-memory object, it is not persistent. After a session is closed, it is destroyed by Cortex. If you want to create a persistent object, please inside your session. See for details.
When you create a session, you can activate it or leave as is.
If the session is not activated, then it doesn't use the license of the user. You cannot subscribe to the EEG stream and you are limited to the low resolution performance metrics. You can neither create a nor .
If the session is activated, then it uses the license of the user. Depending on the license scope of the license, you can subscribe to the EEG stream or high resolution performance metrics. If the license has a session quota, then this session will be debited from this quota.
Use and check the field status to know if a session was activated or not.
The data streams you subscribed to. See .
The ids of all the records created by this session. See .
A . It contains information about the headset linked to this session.
The session was created with , but it doesn't use a license. You can activate or close this session with .
The session was activated with a license. You can close this session with .
Name
Type
Required
Description
cortexToken
string
yes
Name
Type
Required
Description
cortexToken
string
yes
status
string
yes
Must be "open" or "active".
headset
string
no
A token returned by .
A token returned by .
A headset id returned by . If you omit this parameter, then Cortex will use the first connected headset.
This method is to activate or close a session. See Sessions for details.
Name
Type
Required
Description
cortexToken
string
yes
session
string
yes
status
string
yes
Must be "active" or "close".
The result is a session object representing the updated session.
The token returned by .
A session id returned by .