SessionWithActivities
The SessionWithActivities
object is a modified [Session
][session-ref] object. It contains most of the information that the [Session
][session-ref] object stores, adding extra information about the current session's latest activity.
The additional data included in the latest activity are useful for analytics purposes. A SessionActivity
object will provide information about the user's location, device and browser.
While the SessionWithActivities
object wraps the most important information around a [Session
][session-ref] object, the two objects have entirely different methods.
Properties
Name | Type | Description |
---|---|---|
id | string | A unique identifier for the session. |
status | SessionStatus | The current state of the session. |
lastActiveAt | Date | The time the session was last active on the [Client ][client-ref]. |
abandonAt | Date | The time when the session was abandoned by the user. |
expireAt | Date | The time the session expires and will seize to be active. |
latestActivity | SessionActivity | An object that provides additional information about this session, focused around user activity data. |
Methods
revoke()
Marks this session as revoked. If this is the active session, the attempt to revoke it will fail.
Users can revoke only their own sessions.
function revoke(): Promise<SessionWithActivities>;
Types
SessionActivity
Name | Type | Description |
---|---|---|
id | string | A unique identifier for the session activity record. |
browserName | string | undefined | The name of the browser from which this session activity occurred. |
browserVersion | string | undefined | The version of the browser from which this session activity occurred. |
deviceType | string | undefined | The type of the device which was used in this session activity. |
ipAddress | string | undefined | The IP address from which this session activity originated. |
city | string | undefined | The city from which this session activity occurred. Resolved by IP address geo-location. |
country | string | undefined | The country from which this session activity occurred. Resolved by IP address geo-location. |
isMobile | boolean | undefined | Will be set to true if the session activity came from a mobile device. Set to false otherwise. |
Last updated on February 21, 2024