public function write(#[\SensitiveParameter] string $sessionId, string $data): bool
{ // see https://github.com/igbinary/igbinary/issues/146
$this->igbinaryEmptyData ??= \
function_exists('igbinary_serialize'
) ?
igbinary_serialize([]) : '';
if ('' ===
$data ||
$this->igbinaryEmptyData ===
$data) { return $this->
destroy($sessionId);
} $this->newSessionId = null;
return $this->
doWrite($sessionId,
$data);
} public function destroy(#[\SensitiveParameter] string $sessionId): bool
{ if (!
headers_sent() &&
filter_var(\
ini_get('session.use_cookies'
), \FILTER_VALIDATE_BOOL
)) { if (!
isset($this->sessionName
)) { throw new \
LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.',
static::
class));
} $cookie = SessionUtils::
popSessionCookie($this->sessionName,
$sessionId);
/*
* We send an invalidation Set-Cookie header (zero lifetime)
* when either the session was started or a cookie with
* the session name was sent by the client (in which case
* we know it's invalid as a valid session cookie would've
* started the session).
*/