Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shop] fix sessions for cloudrun #133

Merged
merged 5 commits into from
Sep 6, 2023

Conversation

Seburan
Copy link
Contributor

@Seburan Seburan commented Sep 5, 2023

Description

Express JS session management did not work with Firebase/CloudRun due to Firebase constraints. it requires to name the session cookies "__session")

Express JS session management now uses memorystore module, to store session data in memory.

Enable session affinity on Cloud Run in case multiple instances are running so users get their cart content (it's only for demo purpose, in real-life session data should be managed using a third party database like Redis)

Related Issue

  • Fixes #xxx

Affected services

  • Home
  • News
  • [ x] Shop
  • Travel
  • DSP
  • SSP
  • ALL

Other:

@Seburan Seburan changed the base branch from main to dev September 5, 2023 08:13
- Firebase requires to use "__session" as a cookie name.
- Replace default session store by "memorystore"
- Set cookie sameSite attribute to "strict"
in case where multiple instances would run, set up session affinity
to preserve the session state
@JackJey
Copy link
Contributor

JackJey commented Sep 6, 2023

LGTM

@Seburan Seburan merged commit 419875b into privacysandbox:dev Sep 6, 2023
1 check passed
@Seburan Seburan deleted the shop-fix-sessions-for-cloudrun branch September 6, 2023 04:58
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.

2 participants