Docs

SessionWithActivities

The SessionWithActivities object is a modified Session object. It includes most of the information stored in the Session object, with additional details about the latest activity in the current session. SessionWithActivities is returned by the User.getSessions() method.

The additional data included in the latest activity is useful for analytics purposes. A SessionActivity object provides information about the user's location, device and browser.

While the SessionWithActivities object wraps the most important information around a Session object, the two objects have entirely different methods.

Properties

  • Name
    id
    Type
    string
    Description

    A unique identifier for the session.

  • Name
    status
    Type
    SessionStatus
    Description

    The current state of the session.

  • Name
    lastActiveAt
    Type
    Date
    Description

    The time the session was last active on the Client.

  • Name
    abandonAt
    Type
    Date
    Description

    The time when the session was abandoned by the user.

  • Name
    expireAt
    Type
    Date
    Description

    The time the session expires and will seize to be active.

  • Name
    latestActivity
    Type
    SessionActivity
    Description

    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>
  • Name
    id
    Type
    string
    Description

    A unique identifier for the session activity record.

  • Name
    browserName
    Type
    string | undefined
    Description

    The name of the browser from which this session activity occurred.

  • Name
    browserVersion
    Type
    string | undefined
    Description

    The version of the browser from which this session activity occurred.

  • Name
    deviceType
    Type
    string | undefined
    Description

    The type of the device which was used in this session activity.

  • Name
    ipAddress
    Type
    string | undefined
    Description

    The IP address from which this session activity originated.

  • Name
    city
    Type
    string | undefined
    Description

    The city from which this session activity occurred. Resolved by IP address geo-location.

  • Name
    country
    Type
    string | undefined
    Description

    The country from which this session activity occurred. Resolved by IP address geo-location.

  • Name
    isMobile
    Type
    boolean | undefined
    Description

    Will be set to true if the session activity came from a mobile device. Set to false otherwise.

Feedback

What did you think of this content?

Last updated on