disableSessionConfig = $disableSessionConfig; $this->appState = $appState; } /** * Prevents session starting while in graphql area and session is disabled in config. * * @param SessionStartChecker $subject * @param bool $result * @return bool * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.EmptyCatchBlock) */ public function afterCheck(SessionStartChecker $subject, bool $result): bool { if (!$result) { return false; } try { if ($this->appState->getAreaCode() === Area::AREA_GRAPHQL && $this->disableSessionConfig->isDisabled()) { $result = false; } } catch (LocalizedException $e) {} finally { //@codingStandardsIgnoreLine return $result; } } }