Document session: false opt-out and session runtime tree-shaking#14251
Open
adamchal wants to merge 1 commit into
Open
Document session: false opt-out and session runtime tree-shaking#14251adamchal wants to merge 1 commit into
session: false opt-out and session runtime tree-shaking#14251adamchal wants to merge 1 commit into
Conversation
Contributor
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Preview deployment ✅ Deployment complete!
|
adamchal
commented
Jul 15, 2026
| ## Disabling sessions | ||
|
|
||
| <p> | ||
| <Since v="7.1.0" /> |
Contributor
Author
There was a problem hiding this comment.
This may not make the Astro 7.1 release, so this will need to be updated accordingly.
adamchal
commented
Jul 15, 2026
| ``` | ||
| </Steps> | ||
|
|
||
| ## Disabling sessions |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| ## Disabling sessions | |
| ### Disabling sessions |
I think this might be better served as an <h3> so it sits under “Configuring sessions” instead of top level.
Before
- Overview
- Configuring sessions
- Overriding the configuration at runtime
- Disabling sessions
- Interacting with session data
- Astro components and pages
- API endpoints
- Actions
- Middleware
- Session data types
After
- Overview
- Configuring sessions
- Overriding the configuration at runtime
- Disabling sessions
- Interacting with session data
- Astro components and pages
- API endpoints
- Actions
- Middleware
- Session data types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accompanies withastro/astro#16871.
Description (required)
Documents withastro/astro#16871, which adds a
session: falseconfig option to opt out of session support entirely, and tree-shakes the session runtime (AstroSession+unstorage) out of the SSR bundle for any project where no session driver is wired.Changes (English only):
guides/sessions.mdx: new "Disabling sessions" section (<Since v="7.1.0" />) covering thesession: falseoption, that adapters skip wiring their default driver, thatAstro.session/context.sessionareundefined(same as a project without sessions configured, soAstro.session?.get()feature detection keeps working), and a note that the runtime is tree-shaken automatically for any driver-less project even without the flag.reference/api-reference.mdx:sessiontype corrected toAstroSession | undefined, and the disabled case added to the list of situations wheresessionisundefined.guides/integrations-guide/cloudflare.mdx: note in the Sessions section thatsession: falsemeans no KV binding is configured, no KV namespace is provisioned on deploy, and the session runtime is excluded from the Worker bundle.guides/integrations-guide/netlify.mdx: note thatsession: falsemeans Netlify Blobs is not configured for session storage and the runtime is excluded from the function bundle.guides/integrations-guide/node.mdx: note thatsession: falsemeans the filesystem driver is not configured and the runtime is excluded from the server bundle.reference/modules/astro-fetch.mdx: note on thesessions()pipeline handler that it registers no provider (andctx.sessionisundefined) when no driver is configured or sessions are disabled.References
session: falseto opt out of session support astro#168717.1.0(and@astrojs/cloudflare14.2.0,@astrojs/netlify8.2.0,@astrojs/node11.1.0)Discord username: adam.chal