/home/ssdb6609/host.ssdbr.fun/library/PdoSessionHandler.php
$sql = "SELECT $dbDataCol FROM $dbTable WHERE $dbIdCol = :id";
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_STR);
$stmt->execute();
// it is recommended to use fetchAll so that PDO can close the DB cursor
// we anyway expect either no rows, or one row with one column. fetchColumn, seems to be buggy #4777
$sessionRows = $stmt->fetchAll(PDO::FETCH_NUM);
if (count($sessionRows) == 1) {
return base64_decode($sessionRows[0][0]);
}
// session does not exist, create it
$this->createNewSession($id);
return '';
} catch (PDOException $e) {
throw new RuntimeException("PDOException was thrown when trying to read the session data: {$e->getMessage()}.", 0, $e);
}
}
public function write($id, $data): bool
{
// get table/column
$dbTable = $this->dbOptions['db_table'];
$dbDataCol = $this->dbOptions['db_data_col'];
$dbIdCol = $this->dbOptions['db_id_col'];
$dbTimeCol = $this->dbOptions['db_time_col'];
// session data can contain non binary safe characters so we need to encode it
$encoded = base64_encode($data);
try {
$driver = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
if ($driver === 'mysql') {
// MySQL would report $stmt->rowCount() = 0 on UPDATE when the data is left unchanged
// it could result in calling createNewSession() whereas the session already exists in
Arguments
"PDOException was thrown when trying to read the session data: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ssdb6609_host.session' doesn't exist."
/home/ssdb6609/host.ssdbr.fun/library/PdoSessionHandler.php
throw new RuntimeException("PDOException was thrown when trying to manipulate session data: {$e->getMessage()}.", 0, $e);
}
return false;
}
public function read($id): string|false
{
// get table/columns
$dbTable = $this->dbOptions['db_table'];
$dbDataCol = $this->dbOptions['db_data_col'];
$dbIdCol = $this->dbOptions['db_id_col'];
try {
$sql = "SELECT $dbDataCol FROM $dbTable WHERE $dbIdCol = :id";
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_STR);
$stmt->execute();
// it is recommended to use fetchAll so that PDO can close the DB cursor
// we anyway expect either no rows, or one row with one column. fetchColumn, seems to be buggy #4777
$sessionRows = $stmt->fetchAll(PDO::FETCH_NUM);
if (count($sessionRows) == 1) {
return base64_decode($sessionRows[0][0]);
}
// session does not exist, create it
$this->createNewSession($id);
return '';
} catch (PDOException $e) {
throw new RuntimeException("PDOException was thrown when trying to read the session data: {$e->getMessage()}.", 0, $e);
}
}
public function write($id, $data): bool
{
// get table/column
Arguments
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ssdb6609_host.session' doesn't exist"
/home/ssdb6609/host.ssdbr.fun/library/PdoSessionHandler.php
throw new RuntimeException("PDOException was thrown when trying to manipulate session data: {$e->getMessage()}.", 0, $e);
}
return false;
}
public function read($id): string|false
{
// get table/columns
$dbTable = $this->dbOptions['db_table'];
$dbDataCol = $this->dbOptions['db_data_col'];
$dbIdCol = $this->dbOptions['db_id_col'];
try {
$sql = "SELECT $dbDataCol FROM $dbTable WHERE $dbIdCol = :id";
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_STR);
$stmt->execute();
// it is recommended to use fetchAll so that PDO can close the DB cursor
// we anyway expect either no rows, or one row with one column. fetchColumn, seems to be buggy #4777
$sessionRows = $stmt->fetchAll(PDO::FETCH_NUM);
if (count($sessionRows) == 1) {
return base64_decode($sessionRows[0][0]);
}
// session does not exist, create it
$this->createNewSession($id);
return '';
} catch (PDOException $e) {
throw new RuntimeException("PDOException was thrown when trying to read the session data: {$e->getMessage()}.", 0, $e);
}
}
public function write($id, $data): bool
{
// get table/column
/home/ssdb6609/host.ssdbr.fun/library/FOSSBilling/Session.php
$currentCookieParams = session_get_cookie_params();
$currentCookieParams['httponly'] = true;
$currentCookieParams['lifetime'] = 0;
$currentCookieParams['secure'] = $this->shouldBeSecure();
$cookieParams = [
'lifetime' => $currentCookieParams['lifetime'],
'path' => $currentCookieParams['path'],
'domain' => $currentCookieParams['domain'],
'secure' => $currentCookieParams['secure'],
'httponly' => $currentCookieParams['httponly'],
];
if (Config::getProperty('security.mode', 'strict') == 'strict') {
$cookieParams['samesite'] = 'Strict';
}
session_set_cookie_params($cookieParams);
session_start();
$this->updateFingerprint();
}
public function getId(): string
{
return session_id();
}
public function delete(string $key): void
{
unset($_SESSION[$key]);
}
public function get(string $key): mixed
{
return $_SESSION[$key] ?? null;
}
public function set(string $key, mixed $value): void
/home/ssdb6609/host.ssdbr.fun/di.php
*/
$di['events_manager'] = function () use ($di) {
$service = new Box_EventManager();
$service->setDi($di);
return $service;
};
/*
* Creates a new session, applying specified security rules depending on the config.php settings.
*
* @param void
*
* @return \FOSSBilling\Session
*/
$di['session'] = function () use ($di) {
$handler = new PdoSessionHandler($di['pdo']);
$session = new FOSSBilling\Session($handler);
$session->setDi($di);
$session->setupSession();
return $session;
};
/*
* Creates a new request object based on the current request.
*
* @param void
*
* @link https://symfony.com/doc/current/components/http_foundation.html
*
* @return Symfony\Component\HttpFoundation\Request
*/
$di['request'] = fn (): Request => Request::createFromGlobals();
/*
* @param void
*
* @link https://symfony.com/doc/current/components/cache/adapters/filesystem_adapter.html
*
/home/ssdb6609/host.ssdbr.fun/vendor/pimple/pimple/src/Pimple/Container.php
{
if (!isset($this->keys[$id])) {
throw new UnknownIdentifierException($id);
}
if (
isset($this->raw[$id])
|| !\is_object($this->values[$id])
|| isset($this->protected[$this->values[$id]])
|| !\method_exists($this->values[$id], '__invoke')
) {
return $this->values[$id];
}
if (isset($this->factories[$this->values[$id]])) {
return $this->values[$id]($this);
}
$raw = $this->values[$id];
$val = $this->values[$id] = $raw($this);
$this->raw[$id] = $raw;
$this->frozen[$id] = true;
return $val;
}
/**
* Checks if a parameter or an object is set.
*
* @param string $id The unique identifier for the parameter or object
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($id)
{
return isset($this->keys[$id]);
}
/home/ssdb6609/host.ssdbr.fun/index.php
// Rewrite for custom pages
if (str_starts_with($url, '/page/')) {
$url = substr_replace($url, '/custompages/', 0, 6);
}
// Set the final URL
$_GET['_url'] = $url;
$http_err_code = $_GET['_errcode'] ?? null;
$debugBar['time']->startMeasure('session_start', 'Starting / restoring the session');
/*
* Workaround: Session IDs get reset when using PGs like PayPal because of the `samesite=strict` cookie attribute, resulting in the client getting logged out.
* Internally the return and cancel URLs get a restore_session GET parameter attached to them with the proper session ID to restore, so we do so here.
*/
if (!empty($_GET['restore_session'])) {
session_id($_GET['restore_session']);
}
$di['session'];
$debugBar['time']->stopMeasure('session_start');
if (strncasecmp($url, ADMIN_PREFIX, strlen(ADMIN_PREFIX)) === 0) {
define('ADMIN_AREA', true);
$appUrl = str_replace(ADMIN_PREFIX, '', preg_replace('/\?.+/', '', $url));
$app = new Box_AppAdmin([], $debugBar);
} else {
define('ADMIN_AREA', false);
$appUrl = $url;
$app = new Box_AppClient([], $debugBar);
}
$app->setUrl($appUrl);
$app->setDi($di);
$debugBar['time']->startMeasure('translate', 'Setting up translations');
$di['translate']();
$debugBar['time']->stopMeasure('translate');
// If HTTP error code has been passed, handle it.