- md5
- 7c222addb036da1c57d74558380a02b3
- sha1
- e2855fbaff26cb16cac1e57555ddca39c359fb69
- sha256
- 1b1a58a9dc3d1b005fe21a88fb272622c3bf2cddb9a63f7d02f0866f448be2b5
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Session;
/**
* Manager for interacting with the session handler to perform updates on sessions.
*
* @since 4.0.0
*/
final class SessionManager
{
/**
* Session handler.
*
* @var \SessionHandlerInterface
* @since 4.0.0
*/
private $sessionHandler;
/**
* SessionManager constructor.
*
* @param \SessionHandlerInterface $sessionHandler Session handler.
*
* @since 4.0.0
*/
public function __construct(\SessionHandlerInterface $sessionHandler)
{
$this->sessionHandler = $sessionHandler;
}
/**
* Destroys the given session ID.
*
* @param string $sessionId The session ID to destroy.
*
* @return boolean
*
* @since 4.0.0
*/
public function destroySession(string $sessionId): bool
{
return $this->sessionHandler->destroy($sessionId);
}
/**
* Destroys the given session IDs.
*
* @param string[] $sessionIds The session IDs to destroy.
*
* @return boolean
*
* @since 4.0.0
*/
public function destroySessions(array $sessionIds): bool
{
$result = true;
foreach ($sessionIds as $sessionId) {
if (!$this->destroySession($sessionId)) {
$result = false;
}
}
return $result;
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.