throw new \RuntimeException('Failed to start the session: already started by PHP.');
}
if (ini_get('session.use_cookies') && headers_sent($file, $line))
{
throw new \RuntimeException(
sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)
);
}
if (!session_start())
$this->setId($session_clean);
$cookie->set($session_name, '', time() - 3600);
}
}
parent::start();
// Try loading data from the session
if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) {
$this->data = unserialize(base64_decode($_SESSION['joomla']));
}
if ($this->isStarted())
{
return;
}
$this->store->start();
$this->setState(SessionState::ACTIVE);
// Initialise the session
$this->setCounter();
*/
public function has($name)
{
if (!$this->isActive())
{
$this->start();
}
return $this->store->has($name);
}
$name = $args[2] . '.' . $name;
}
}
if (parent::has($name)) {
// Parent is used because of b/c, can be changed in Joomla 5
return parent::get($name, $default);
}
/*
$crlf = '<br>';
}
echo "<br> line: " . __LINE__ . " after crlf" ;
echo "<br>line: " . __LINE__ . " try to set user";
$user = $app->getSession()->get('user');
if ($user->guest) {
echo 'this is a guest user' . $crlf;
} else {
echo 'user id = ' . $user->id . ', name = ' . $user->name . $crlf;
}
<?php
// teamforms.php
/// must be before header
include "includes/session.php"; // access joomla login
$ifadmin = ($my->usertype == 'Administrator' || $my->usertype == 'Super Administrator' );
/// init variables ///
$script_version = $parent_version = "021f4-008g1" ; // 20240204
$script_name = basename(__FILE__);
RuntimeException
|
---|
RuntimeException: Failed to start the session because headers have already been sent by "/home/usbf/public_html/apps/includes/session.php" at line 33. at /home/usbf/public_html/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:473 at Joomla\Session\Storage\NativeStorage->start() (/home/usbf/public_html/libraries/src/Session/Storage/JoomlaStorage.php:295) at Joomla\CMS\Session\Storage\JoomlaStorage->start() (/home/usbf/public_html/libraries/vendor/joomla/session/src/Session.php:406) at Joomla\Session\Session->start() (/home/usbf/public_html/libraries/vendor/joomla/session/src/Session.php:333) at Joomla\Session\Session->has('user') (/home/usbf/public_html/libraries/src/Session/Session.php:194) at Joomla\CMS\Session\Session->get('user') (/home/usbf/public_html/apps/includes/session.php:92) at include('/home/usbf/public_html/apps/includes/session.php') (/home/usbf/public_html/apps/teamforms.php:5) |