Skip to content

SessionData

  • Full name: \Qubus\Http\Session\SessionData
  • This class is marked as final and can't be subclassed
  • This class implements: \Qubus\Http\Session\HttpSession
  • This class is a Final class

Properties

oldSessionId

private string|null $oldSessionId

objects

private \Qubus\Http\Session\SessionEntity[] $objects

clientSessionId

private string $clientSessionId

data

private array $data

isNew

private bool $isNew

Methods

__construct

public __construct(string $clientSessionId, array $data = [], bool $isNew = false): mixed

Parameters:

Parameter Type Description
$clientSessionId string
$data array
$isNew bool

sessionId

Returns the session's uuid which is derived from the client session's id.

public sessionId(): string

Throws:


clientSessionId

Client session id which is stored in client's cookie and never on the server.

public clientSessionId(): string

getData

Returns an array of object data.

public getData(): array

Throws:


get

Retrieve session entity.

public get(string $type): \Qubus\Http\Session\SessionEntity

Parameters:

Parameter Type Description
$type string Fully qualified class name.

Throws:


clear

Clear all session data, evict all objects from this Session, and renew {@see renew()} the Session ID.

public clear(): void

Throws:


renew

Explicitly renew the Session ID while preserving any Session data.

public renew(): void

Throws:


isNew

public isNew(): bool

isRenewed

public isRenewed(): bool

oldSessionID

public oldSessionID(): ?string

checksum

Internally checksum a class implementation.

protected checksum(string $type): string

Any change to the class source-file will cause invalidation of the session-model, such that changes to the code will effectively cause session-models to re-initialize to their default state - this is necessary because even a change to a type-hint in a doc-block could cause an unserialize() call to inject the wrong type of value.

Parameters:

Parameter Type Description
$type string fully-qualified class-name

Return Value:

MD5 checksum

Throws:



Automatically generated on 2025-10-13