{"record":{"id":"090c36dad461db63","repo":"octobercms/october","slug":"writing-to-reserved-session-key-s-is-blocked-in","errorCode":null,"errorMessage":"Writing to reserved session key \"%s\" is blocked in Safe Mode.","messagePattern":"Writing to reserved session key \"(.+?)\" is blocked in Safe Mode\\.","errorType":"exception","errorClass":"Twig\\Sandbox\\SecurityNotAllowedMethodError","httpStatus":null,"severity":"error","filePath":"modules/system/twig/securitypolicy/SafeSessionStore.php","lineNumber":119,"sourceCode":"     */\n    protected function assertKeyAllowed(string $method, $key): void\n    {\n        if (is_array($key)) {\n            foreach (array_keys($key) as $k) {\n                $this->assertKeyAllowed($method, $k);\n            }\n            return;\n        }\n\n        if (!is_string($key) || $key === '') {\n            return;\n        }\n\n        $topKey = strstr($key, '.', true) ?: $key;\n\n        foreach ($this->reservedKeyPrefixes as $prefix) {\n            if (str_starts_with($topKey, $prefix)) {\n                throw new SecurityNotAllowedMethodError(\n                    sprintf('Writing to reserved session key \"%s\" is blocked in Safe Mode.', $key),\n                    Store::class,\n                    $method\n                );\n            }\n        }\n    }\n}\n","sourceCodeStart":101,"sourceCodeEnd":128,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/twig/securitypolicy/SafeSessionStore.php#L101-L128","documentation":"Error \"Writing to reserved session key \"%s\" is blocked in Safe Mode.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/system/twig/securitypolicy/SafeSessionStore.php:119 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"}