AuthSession

The AuthSession object represents an individual user session in your organization. This object is available in versions 29.0 and later.

Supported Calls

delete()describeSObjects()query()retrieve()

Fields

Field Name Details
CreatedDate
Type
dateTime
Properties
Defaulted on create, Filter, Sort
Description
The date and time this session was created. This field is a standard system field.
IsCurrent
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the session is a member of the user’s current session family. This field is available in API version 37.0 and later.
LastModifiedDate
Type
dateTime
Properties
Defaulted on create, Filter, Sort
Description
The date and time this session was last updated. A session expires when the current date and time equals LastModifiedDate + NumSecondsValid. This field is a standard system field.
LoginGeoId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The 18-character ID for the record of the geographic location of the user for a login event. Due to the nature of geolocation technology, the accuracy of geolocation fields (for example, country, city, postal code) can vary. This field is available in API version 34.0 and later.
LoginHistoryId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The 18-character ID for a successful login event. When a session is reused, Salesforce updates the LoginHistoryId with the value from the most recent login. This field is available in API version 33.0 and later.
LoginType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of login, for example, Application.
LogoutUrl
Type
string
Properties
Filter, Nillable, Sort
Description
The page or view to display after users log out of a community, or an organization if they authenticated using SAML. This field is available in API version 32.0 and later.
NumSecondsValid
Type
int
Properties
Filter, Group, Sort
Description
The number of seconds before the session expires, starting from the last update time.
ParentId
Type
reference
Properties
Filter, Group, Sort
Description
The 18-character ID for the parent session, if one exists (for example, if the current session is for a canvas app). If the current session doesn’t have a parent, this value is the current session’s own ID.
SessionSecurityLevel
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Standard or High, depending upon the authentication method used.
SessionType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of session. Common ones are UI, Content, API, and Visualforce.
SourceIp
Type
string
Properties
Filter, Group, Sort
Description
IP address of the end user’s device from which the session started. This address can be an IPv4 or IPv6 address.
UserType
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The kind of user for this session. Types include Standard, Partner, Customer Portal Manager, High Volume Portal, and CSN Only.
UsersId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The user’s Salesforce user ID.

Usage

The AuthSession object exposes session data and enables read and delete operations on that data. For example, use this object to create a report showing who is signed in to your organization, or to create a tool to delete a session, ending that user’s session. For a user, only their own sessions are available, while administrators can see all sessions.

You can’t change user sessions with this object. You can only read and delete them.