MCP PHP SDK

SessionManager implements SessionManagerInterface

Default implementation of SessionManagerInterface.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Interfaces

SessionManagerInterface
Factory interface for creating session instances.

Properties

$logger  : LoggerInterface
$store  : SessionStoreInterface

Methods

__construct()  : mixed
create()  : SessionInterface
Creates a new session with an auto-generated UUID.
createWithId()  : SessionInterface
Creates a session with a specific UUID.
destroy()  : bool
Destroys the session with the given UUID.
exists()  : bool
Checks if a session with the given UUID exists.
gc()  : void
Run garbage collection on expired sessions.

Properties

$logger read-only

private LoggerInterface $logger = new NullLogger()

Methods

destroy()

Destroys the session with the given UUID.

public destroy(Uuid $id) : bool
Parameters
$id : Uuid
Return values
bool

exists()

Checks if a session with the given UUID exists.

public exists(Uuid $id) : bool
Parameters
$id : Uuid
Return values
bool

gc()

Run garbage collection on expired sessions.

public gc() : void

Uses the session store's internal TTL configuration.


        
On this page

Search results