phpday 2027 - Call for Papers

SessionHandler::validateId

(PHP 8 >= 8.6.0)

SessionHandler::validateId — Validate a session ID

说明

public function SessionHandler::validateId(string $id): bool

Validates a given session ID by delegating to the internal save handler. A session ID is valid if a session with that ID already exists. This method is called when a session is started with a supplied session ID and session.use_strict_mode is enabled.

参数

id

The session ID.

返回值

Returns true for a valid ID, false otherwise.

错误/异常

Throws an Error if the session is not active, or if there is no default session handler to call.

If the parent save handler is not open, for example because a subclass overrides SessionHandler::open() without calling the parent method, an E_WARNING is raised and true is returned.

+添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top