{"record":{"id":"d836cf0d2e78d669","repo":"octobercms/october","slug":"calling-s-method-on-a-session-is-blocked-in-saf","errorCode":null,"errorMessage":"Calling \"%s\" method on a session is blocked in Safe Mode.","messagePattern":"Calling \"(.+?)\" method on a session is blocked in Safe Mode\\.","errorType":"exception","errorClass":"Twig\\Sandbox\\SecurityNotAllowedMethodError","httpStatus":null,"severity":"error","filePath":"modules/system/twig/securitypolicy/SafeSessionStore.php","lineNumber":83,"sourceCode":"        'errors',             // Validation error bag\n        'widget.',            // Backend SessionMaker widget state (consumed by unserialize)\n    ];\n\n    /**\n     * __construct\n     */\n    public function __construct(Store $session)\n    {\n        $this->session = $session;\n    }\n\n    /**\n     * __call magic\n     */\n    public function __call($method, $parameters)\n    {\n        if (!in_array($method, $this->allowedMethods, true)) {\n            throw new SecurityNotAllowedMethodError(\n                sprintf('Calling \"%s\" method on a session is blocked in Safe Mode.', $method),\n                Store::class,\n                $method\n            );\n        }\n\n        if (in_array($method, $this->writeMethods, true)) {\n            $this->assertKeyAllowed($method, $parameters[0] ?? null);\n        }\n\n        return $this->session->{$method}(...$parameters);\n    }\n\n    /**\n     * assertKeyAllowed rejects writes to reserved session key prefixes.\n     * Arrays (e.g. put(['k' => 'v'], ...)) and dot-notation keys are\n     * normalized to their top-level segment before checking.\n     */","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/twig/securitypolicy/SafeSessionStore.php#L65-L101","documentation":"Error \"Calling \"%s\" method on a session is blocked in Safe Mode.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/system/twig/securitypolicy/SafeSessionStore.php:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}