* @throws \LogicException
*/
public function setName(string $name)
{
if ($this->isActive()) {
throw new \LogicException('Cannot change the name of an active session.');
}
session_name($name);
}
}
/**
* {@inheritdoc}
*/
public function setName(string $name)
{
$this->saveHandler->setName($name);
}
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
public function setName(string $name)
{
$this->storage->setName($name);
}
/**
* {@inheritdoc}
*/
}
$session = $master->getSession();
if (!$session->isStarted()) {
$session->setName('session-');
$session->start();
$session->set('sessionId', $session->getId());
}
$salesChannelId = $master->attributes->get(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_ID);
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (!$event instanceof FlowEventAware) {
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) {
return $event;
}
$this->definitionRegistry = $definitionRegistry;
}
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (Feature::isActive('FEATURE_NEXT_17858')) {
return $event;
}
}
$this->dispatch($nested, $name);
}
}
return $this->dispatcher->dispatch($event, $eventName);
}
/**
* @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283
*/
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
*/
private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response
{
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$throwable = $event->getThrowable();
$request = $this->duplicateRequest($throwable, $event->getRequest());
try {
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false);
} catch (\Exception $e) {
$f = FlattenException::createFromThrowable($e);
$this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), $e->getFile(), $e->getLine()));
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (!$event instanceof FlowEventAware) {
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) {
return $event;
}
$this->definitionRegistry = $definitionRegistry;
}
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (Feature::isActive('FEATURE_NEXT_17858')) {
return $event;
}
}
$this->dispatch($nested, $name);
}
}
return $this->dispatcher->dispatch($event, $eventName);
}
/**
* @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283
*/
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
* @throws \Exception
*/
private function handleThrowable(\Throwable $e, Request $request, int $type): Response
{
$event = new ExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch($event, KernelEvents::EXCEPTION);
// a listener might have replaced the exception
$e = $event->getThrowable();
if (!$event->hasResponse()) {
{
if (!$request = $request ?: $this->requestStack->getMainRequest()) {
throw $exception;
}
$response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
$response->sendHeaders();
$response->sendContent();
$this->terminate($request, $response);
if ($hasRun) {
throw $e;
}
$hasRun = true;
$kernel->terminateWithException($e, $request);
};
}
} elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) {
$output = $event->getOutput();
if ($output instanceof ConsoleOutputInterface) {
$this->exceptionHandler = null;
}
try {
if (null !== $exceptionHandler) {
return $exceptionHandler($exception);
}
$handlerException = $handlerException ?: $exception;
} catch (\Throwable $handlerException) {
}
if ($exception === $handlerException && null === $this->exceptionHandler) {
* @return int|false
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
return $this->handler->gc($maxlifetime);
}
}
* @return int|false
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
return $this->handler->gc($maxlifetime);
}
/**
* @return bool
*/
// the session ID in the header is invalid, create a new one
session_id(session_create_id());
}
// ok to try and start the session
if (!session_start()) {
throw new \RuntimeException('Failed to start the session.');
}
if (null !== $this->emulateSameSite) {
$originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
/**
* {@inheritdoc}
*/
public function start()
{
return $this->storage->start();
}
/**
* {@inheritdoc}
*/
*/
public function hasToken(string $tokenId)
{
$session = $this->getSession();
if (!$session->isStarted()) {
$session->start();
}
return $session->has($this->namespace.'/'.$tokenId);
}
* {@inheritdoc}
*/
public function getToken(string $tokenId)
{
$namespacedId = $this->getNamespace().$tokenId;
if ($this->storage->hasToken($namespacedId)) {
$value = $this->storage->getToken($namespacedId);
} else {
$value = $this->generator->generateToken();
$this->storage->setToken($namespacedId, $value);
return $response;
}
private function getToken(string $intent): string
{
return $this->csrfTokenManager->getToken($intent)->getValue();
}
private function createSession(Request $request): SessionInterface
{
$session = new Session($this->sessionFactory->createStorage($request));
$intent = $matches['intent'];
$token = $processedIntents[$intent] ?? null;
// Don't generate the token and set the cookie again
if ($token === null) {
$token = $this->getToken($intent);
$cookie = Cookie::create('csrf[' . $intent . ']', $token);
$cookie->setSecureDefault($request->isSecure());
$response->headers->setCookie($cookie);
$processedIntents[$intent] = $token;
}
$processedIntents = [];
// https://regex101.com/r/fefx3V/1
$content = preg_replace_callback(
'/' . self::CSRF_PLACEHOLDER . '(?<intent>[^#]*)#/',
function ($matches) use ($response, $request, &$processedIntents) {
$intent = $matches['intent'];
$token = $processedIntents[$intent] ?? null;
// Don't generate the token and set the cookie again
}
public function replaceCsrfToken(BeforeSendResponseEvent $event): void
{
$event->setResponse(
$this->csrfPlaceholderHandler->replaceCsrfToken($event->getResponse(), $event->getRequest())
);
}
public function addHreflang(StorefrontRenderEvent $event): void
{
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (!$event instanceof FlowEventAware) {
return $event;
}
*
* @return TEvent
*/
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) {
return $event;
}
$this->definitionRegistry = $definitionRegistry;
}
public function dispatch($event, ?string $eventName = null): object
{
$event = $this->dispatcher->dispatch($event, $eventName);
if (Feature::isActive('FEATURE_NEXT_17858')) {
return $event;
}
}
$this->dispatch($nested, $name);
}
}
return $this->dispatcher->dispatch($event, $eventName);
}
/**
* @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283
*/
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
$response = $kernel->handle($transformed, $type, $catch);
// fire event to trigger runtime events like seo url headers
$event = new BeforeSendResponseEvent($transformed, $response);
$container->get('event_dispatcher')->dispatch($event);
return new HttpKernelResult($transformed, $event->getResponse());
}
private function createKernel(): KernelInterface
if (!\is_bool($catch)) {
Feature::triggerDeprecationOrThrow('v6.5.0.0', 'The third parameter `$catch` of `HttpKernel->handle()` will be typed to `bool`');
}
try {
return $this->doHandle($request, (int) $type, (bool) $catch);
} catch (DBALException $e) {
$connectionParams = self::getConnection()->getParams();
$message = str_replace([$connectionParams['url'] ?? null, $connectionParams['password'] ?? null, $connectionParams['user'] ?? null], '******', $e->getMessage());
}
} else {
$kernel = new InstallerKernel($appEnv, $debug);
}
$result = $kernel->handle($request);
if ($result instanceof Response) {
$result->send();
$kernel->terminate($request, $result);
} else {
[2/2]
LogicException
|
---|
LogicException: Cannot change the name of an active session. at /data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php:113 at Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy->setName() (/data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:230) at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->setName() (/data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Session.php:232) at Symfony\Component\HttpFoundation\Session\Session->setName() (/data/www/allnet.co.hu/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php:175) at Shopware\Storefront\Framework\Routing\StorefrontSubscriber->startSession() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:51) at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:96) at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php:53) at Shopware\Core\Framework\Event\BusinessEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:35) at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/HttpKernel.php:129) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/EventListener/ErrorListener.php:85) at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:51) at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:96) at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php:53) at Shopware\Core\Framework\Event\BusinessEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:35) at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/HttpKernel.php:213) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/HttpKernel.php:109) at Symfony\Component\HttpKernel\HttpKernel->terminateWithException() (/data/www/allnet.co.hu/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:131) at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}() (/data/www/allnet.co.hu/vendor/symfony/error-handler/ErrorHandler.php:607) at Symfony\Component\ErrorHandler\ErrorHandler->handleException() |
[1/2]
ErrorException
|
---|
ErrorException: Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) at /data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php:116 at Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler->gc() (/data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php:91) at Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->gc() at session_start() (/data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:185) at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (/data/www/allnet.co.hu/vendor/symfony/http-foundation/Session/Session.php:61) at Symfony\Component\HttpFoundation\Session\Session->start() (/data/www/allnet.co.hu/vendor/symfony/security-csrf/TokenStorage/SessionTokenStorage.php:98) at Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage->hasToken() (/data/www/allnet.co.hu/vendor/symfony/security-csrf/CsrfTokenManager.php:72) at Symfony\Component\Security\Csrf\CsrfTokenManager->getToken() (/data/www/allnet.co.hu/vendor/shopware/storefront/Framework/Csrf/CsrfPlaceholderHandler.php:115) at Shopware\Storefront\Framework\Csrf\CsrfPlaceholderHandler->getToken() (/data/www/allnet.co.hu/vendor/shopware/storefront/Framework/Csrf/CsrfPlaceholderHandler.php:91) at Shopware\Storefront\Framework\Csrf\CsrfPlaceholderHandler->Shopware\Storefront\Framework\Csrf\{closure}() at preg_replace_callback() (/data/www/allnet.co.hu/vendor/shopware/storefront/Framework/Csrf/CsrfPlaceholderHandler.php:84) at Shopware\Storefront\Framework\Csrf\CsrfPlaceholderHandler->replaceCsrfToken() (/data/www/allnet.co.hu/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php:339) at Shopware\Storefront\Framework\Routing\StorefrontSubscriber->replaceCsrfToken() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:51) at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:96) at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php:53) at Shopware\Core\Framework\Event\BusinessEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:35) at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/data/www/allnet.co.hu/vendor/shopware/core/HttpKernel.php:153) at Shopware\Core\HttpKernel->doHandle() (/data/www/allnet.co.hu/vendor/shopware/core/HttpKernel.php:75) at Shopware\Core\HttpKernel->handle() (/data/www/allnet.co.hu/public/index.php:85) |