final class SessionIdGenerator (View source)

Generates and validates canonical identifiers for non-native session storage.

Identifiers contain 32 cryptographically secure random bytes encoded as 64 lowercase hexadecimal characters.

Constants

private RANDOM_BYTES

private PATTERN

Methods

string

Generates a cryptographically secure canonical session identifier.

string
bool
isValid(string $sessionId)

Reports whether a value has the canonical non-native session identifier format.

bool

Details

generate

string generate()

Generates a cryptographically secure canonical session identifier.

Return Value

string

isValid

bool isValid(string $sessionId)

Reports whether a value has the canonical non-native session identifier format.

Parameters

string $sessionId

Return Value

bool