Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions src/content/docs/en/reference/configuration-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1189,25 +1189,29 @@ See [the sessions guide](/en/guides/sessions/) for more information.

<p>

**Type:** `string | undefined`<br />
**Type:** `SessionDriverConfig | undefined`<br />
<Since v="5.7.0" />
</p>

The Unstorage driver to use for session storage. The [Node](/en/guides/integrations-guide/node/#sessions),
The driver to use for session storage. The [Node](/en/guides/integrations-guide/node/#sessions),
[Cloudflare](/en/guides/integrations-guide/cloudflare/#sessions), and
[Netlify](/en/guides/integrations-guide/netlify/#sessions) adapters automatically configure a default driver for you,
but you can specify your own if you would prefer or if you are using an adapter that does not provide one.

The value is the "Driver name" from the [Unstorage driver documentation](https://unstorage.unjs.io/drivers).
```js title="astro.config.mjs" ins={7-9} ins=" sessionDrivers "
import { defineConfig, sessionDrivers } from 'astro/config'
import vercel from '@astrojs/vercel'

```js title="astro.config.mjs" ins={4}
{
adapter: vercel(),
export default defineConfig({
adapter: vercel()
session: {
driver: "redis",
},
}
driver: sessionDrivers.redis({
url: process.env.REDIS_URL
}),
}
})
```

:::note
Some drivers may need extra packages to be installed. Some drivers may also require environment variables or credentials to be set. See the [Unstorage documentation](https://unstorage.unjs.io/drivers) for more information.
:::
Expand All @@ -1221,6 +1225,10 @@ Some drivers may need extra packages to be installed. Some drivers may also requ
<Since v="5.7.0" />
</p>

:::caution[Deprecated]
This is deprecated and will be removed in a future major version. Instead, pass options to the driver function.
:::

The driver-specific options to use for session storage. The options depend on the driver you are using. See the [Unstorage documentation](https://unstorage.unjs.io/drivers)
for more information on the options available for each driver.

Expand Down