WorkOS PHP SDK

SessionCreatedData
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

The event payload.

Table of Contents

Interfaces

JsonSerializable

Properties

$authMethod  : UserSessionsAuthMethod
The authentication method used to create this session.
$createdAt  : DateTimeImmutable
An ISO 8601 timestamp.
$endedAt  : DateTimeImmutable|null
The timestamp when the session ended.
$expiresAt  : DateTimeImmutable
The timestamp when the session expires.
$id  : string
The unique ID of the session.
$impersonator  : SessionCreatedDataImpersonator|null
Information about the impersonator if this session was created via impersonation.
$ipAddress  : string|null
The IP address from which the session was created.
$object  : string
Distinguishes the session object.
$organizationId  : string|null
The ID of the organization this session is associated with.
$status  : UserSessionsStatus
The current status of the session.
$updatedAt  : DateTimeImmutable
An ISO 8601 timestamp.
$userAgent  : string|null
The user agent string from the device that created the session.
$userId  : string
The ID of the user this session belongs to.

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array<string|int, mixed>
toArray()  : array<string|int, mixed>

Properties

$endedAt

The timestamp when the session ended.

public DateTimeImmutable|null $endedAt

$expiresAt

The timestamp when the session expires.

public DateTimeImmutable $expiresAt

$ipAddress

The IP address from which the session was created.

public string|null $ipAddress

$organizationId

The ID of the organization this session is associated with.

public string|null $organizationId = null

$userAgent

The user agent string from the device that created the session.

public string|null $userAgent

Methods

__construct()

public __construct(string $object, string $id, string|null $ipAddress, string|null $userAgent, string $userId, UserSessionsAuthMethod $authMethod, UserSessionsStatus $status, DateTimeImmutable $expiresAt, DateTimeImmutable|null $endedAt, DateTimeImmutable $createdAt, DateTimeImmutable $updatedAt[, SessionCreatedDataImpersonator|null $impersonator = null ][, string|null $organizationId = null ]) : mixed
Parameters
$object : string
$id : string
$ipAddress : string|null
$userAgent : string|null
$userId : string
$authMethod : UserSessionsAuthMethod
$status : UserSessionsStatus
$expiresAt : DateTimeImmutable
$endedAt : DateTimeImmutable|null
$createdAt : DateTimeImmutable
$updatedAt : DateTimeImmutable
$impersonator : SessionCreatedDataImpersonator|null = null
$organizationId : string|null = null

fromArray()

public static fromArray(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results