{"record":{"id":"ead1a48131cd7fb1","repo":"withastro/astro","slug":"using-deprecated-session-driver-string-signature","errorCode":null,"errorMessage":"Using deprecated `session.driver` string signature. Learn how to migrate: https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-session-driver-string-signature","messagePattern":"Using deprecated `session\\.driver` string signature\\. Learn how to migrate: https://docs\\.astro\\.build/en/guides/upgrade-to/v6/#deprecated-session-driver-string-signature","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/core/session/config.ts","lineNumber":12,"sourceCode":"import * as z from 'zod/v4';\n\nexport const SessionDriverConfigSchema = z.object({\n\tconfig: z.record(z.string(), z.any()).optional(),\n\tentrypoint: z.union([z.string(), z.instanceof(URL)]),\n});\n\nconst SessionObjectSchema = z.object({\n\tdriver: z\n\t\t.union([\n\t\t\tz.string().superRefine(() => {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Using deprecated \\`session.driver\\` string signature. Learn how to migrate: https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-session-driver-string-signature`,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tSessionDriverConfigSchema,\n\t\t])\n\t\t.optional(),\n\toptions: z.record(z.string(), z.any()).optional(),\n\tcookie: z\n\t\t.union([\n\t\t\tz.object({\n\t\t\t\tname: z.string().optional(),\n\t\t\t\tdomain: z.string().optional(),\n\t\t\t\tpath: z.string().optional(),\n\t\t\t\tmaxAge: z.number().optional(),\n\t\t\t\tsameSite: z.union([z.enum(['strict', 'lax', 'none']), z.boolean()]).optional(),\n\t\t\t\tsecure: z.boolean().optional(),\n\t\t\t}),\n\t\t\tz.string().transform((name) => ({ name })),","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/core/session/config.ts#L1-L30","documentation":"Astro 6 structures session.driver as an object ({ entrypoint, config }); the zod schema still accepts the legacy string form but its superRefine runs a plain console.warn flagging the deprecation with the v6 migration link. It fires during config parsing, once per validation, on every dev start, build, or config reload that still uses the string.","triggerScenarios":"astro.config contains session: { driver: 'fs' } (or any string) instead of { driver: { entrypoint: ..., config: ... } }.","commonSituations":"Upgrading to Astro 6 with a v5-era session config; copying pre-v6 docs or blog snippets; CI logs filling with the warning on each cold start.","solutions":["Replace the string with the object form, e.g. driver: { entrypoint: 'astro/session/drivers/file', config: { path: './.session' } }","Follow the linked v6 migration section for the driver you use","Restart astro dev afterwards and confirm the warning is gone"],"exampleFix":"// astro.config.mjs — before\nsession: { driver: 'fs', options: { path: './.session' } },\n\n// after\nsession: {\n  driver: {\n    entrypoint: 'astro/session/drivers/file',\n    config: { path: './.session' },\n  },\n},","handlingStrategy":"type-guard","validationCode":"const driver = astroConfig.session?.driver;\nif (typeof driver === 'string') {\n  throw new Error('session.driver string form is deprecated — migrate to { entrypoint, config }');\n}","typeGuard":"function isLegacyDriver(d: unknown): d is string {\n  return typeof d === 'string';\n}","tryCatchPattern":null,"preventionTips":["Migrate session config to the object form as part of the v6 upgrade itself","Grep for \"driver: '\" in astro.config files after upgrading","Read the linked upgrade guide before pinning an old behavior"],"tags":["session","deprecation","config","astro-v6","zod"],"backgroundTag":"deprecated-config-option","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}