Skip to content

docs(firebase): set maxAge on session cookie in signin example - #14536

Closed
sharadvc wants to merge 1 commit into
withastro:mainfrom
sharadvc:cursor/firebase-session-cookie-maxage-ebc1
Closed

sharadvc wants to merge 1 commit into
withastro:mainfrom
sharadvc:cursor/firebase-session-cookie-maxage-ebc1

Conversation

@sharadvc

Copy link
Copy Markdown

Summary

The Firebase auth signin example created a 5-day session cookie via expiresIn but did not set maxAge on Astro's cookies.set(), so browsers treated __session as a session cookie and cleared it on tab close.

Adds maxAge: fiveDays / 1000 so the browser lifetime matches the Firebase cookie.

Test plan

  • Diff is English guide only (src/content/docs/en/guides/backend/firebase.mdx)
  • Confirm snippet renders on the Firebase backend guide preview

Closes #14526

Align browser cookie lifetime with the five-day Firebase session cookie
by passing maxAge (seconds) to cookies.set.

Fixes withastro#14526
@astrobot-houston

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/backend/firebase.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ArmandPhilippot

Copy link
Copy Markdown
Member

See #14541 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firebase auth example - Cookie expiration clarification

3 participants