{"record":{"id":"2e8a7e55c76df578","repo":"symfony/http-foundation","slug":"the-following-options-are-not-supported-s","errorCode":null,"errorMessage":"The following options are not supported \"%s\".","messagePattern":"The following options are not supported \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Session/Storage/Handler/MemcachedSessionHandler.php","lineNumber":48,"sourceCode":"     * Key prefix for shared environments.\n     */\n    private string $prefix;\n\n    /**\n     * Constructor.\n     *\n     * List of available options:\n     *  * prefix: The prefix to use for the memcached keys in order to avoid collision\n     *  * ttl: The time to live in seconds.\n     *\n     * @throws \\InvalidArgumentException When unsupported options are passed\n     */\n    public function __construct(\n        private \\Memcached $memcached,\n        array $options = [],\n    ) {\n        if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime', 'ttl'])) {\n            throw new \\InvalidArgumentException(\\sprintf('The following options are not supported \"%s\".', implode(', ', $diff)));\n        }\n\n        $this->ttl = $options['expiretime'] ?? $options['ttl'] ?? null;\n        $this->prefix = $options['prefix'] ?? 'sf2s';\n    }\n\n    public function close(): bool\n    {\n        return $this->memcached->quit();\n    }\n\n    protected function doRead(#[\\SensitiveParameter] string $sessionId): string\n    {\n        return $this->memcached->get($this->prefix.$sessionId) ?: '';\n    }\n\n    public function updateTimestamp(#[\\SensitiveParameter] string $sessionId, string $data): bool\n    {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/symfony/http-foundation/blob/5aea19cd678fa4140f6108406f1096de5e9ed6e4/Session/Storage/Handler/MemcachedSessionHandler.php#L30-L66","documentation":"MemcachedSessionHandler's constructor accepts only the options 'prefix', 'expiretime', and 'ttl'. Passing any other option key throws InvalidArgumentException listing the unsupported keys. This fails fast so a typoed or legacy option (e.g. 'expiretime' vs 'lifetime') does not silently misconfigure the session store.","triggerScenarios":"new MemcachedSessionHandler($memcached, ['expiretime' => 3600, 'foo' => 'bar']) — any key outside ['prefix','expiretime','ttl'] triggers the error; common with typos or options copied from RedisSessionHandler (e.g. 'ttl' confusion is fine, but 'host','port','lifetime' are not).","commonSituations":"Copy-pasting DSN/option arrays between session handler backends; Symfony YAML config referencing an old option name after a library upgrade; typos such as 'expirtime' or 'prefixes'.","solutions":["Remove unsupported keys from the options array; keep only 'prefix', 'expiretime', and/or 'ttl'","Fix the option name typo (compare against ['prefix','expiretime','ttl'])","If configuring via framework bundle config, check the reference for your installed version — valid option names changed historically ('expiretime' vs 'lifetime')","Set memcached server connection options on the \\Memcached client itself, not in the handler options array"],"exampleFix":"// before\n$handler = new MemcachedSessionHandler($memcached, ['prefix' => 'sess_', 'lifetime' => 3600]);\n// after\n$handler = new MemcachedSessionHandler($memcached, ['prefix' => 'sess_', 'expiretime' => 3600]);","handlingStrategy":"validation","validationCode":"$allowed = ['prefix', 'expiretime', 'ttl'];\n$diff = array_diff(array_keys($options), $allowed);\nif ($diff) {\n    throw new InvalidArgumentException('Unsupported MemcachedSessionHandler options: ' . implode(', ', $diff));\n}","typeGuard":null,"tryCatchPattern":"try {\n    $handler = new MemcachedSessionHandler($memcached, $options);\n} catch (\\InvalidArgumentException $e) {\n    // log and correct the config: keep only 'prefix', 'expiretime', 'ttl'\n}","preventionTips":["Whitelist config keys against ['prefix','expiretime','ttl'] before constructing the handler","Do not copy option arrays between Redis/Memcached/PDO session handlers","Consult the reference for your installed library version — option names changed historically","Put connection-level settings on the \\Memcached client, not in handler options"],"tags":["session","memcached","configuration"],"backgroundTag":"unsupported-config-value","analyzedSha":"5aea19cd678fa4140f6108406f1096de5e9ed6e4","analyzedAt":"2026-09-13T01:52:22.855Z","contentChangedAt":"2026-09-13T01:52:22.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}