Skip to content

Document session, sales-channel context, and cart lifecycles with clear config boundaries#2308

Open
Copilot wants to merge 6 commits into
mainfrom
copilot/docs-missing-session-lifetime-docs
Open

Document session, sales-channel context, and cart lifecycles with clear config boundaries#2308
Copilot wants to merge 6 commits into
mainfrom
copilot/docs-missing-session-lifetime-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

The docs did not explain how Symfony session lifetime, Store API context lifetime, persisted sales-channel context, and cart expiration interact, which made login/cart persistence behavior hard to reason about. This update adds a single, centralized explanation that separates each lifecycle and its controlling config.

  • Added lifecycle overview in guides/hosting/performance/session.md

    • New section: Session, context, and cart lifetime
    • Clarifies that these lifecycles are independent and can expire at different times.
  • Added UML sequence diagram (Mermaid)

    • Visualizes flow across browser session cookie, Symfony session, sales-channel context token, and cart token.
  • Added config-to-behavior comparison table

    • Distinguishes each setting by scope, token/data affected, and expiration effect:
      • framework.session.cookie_lifetime
      • framework.session.gc_maxlifetime
      • shopware.api.store.context_lifetime
      • shopware.sales_channel_context.expire_days
      • shopware.cart.expire_days
  • Added concise risk/capacity guidance

    • Notes security tradeoffs of longer lifetimes on shared devices.
    • Notes infrastructure impact (e.g., higher Redis memory usage) for longer retention windows.
sequenceDiagram
    participant Browser
    participant Symfony Session
    participant Sales Channel Context
    participant Cart
    Browser->>Symfony Session: Store session cookie
    Symfony Session->>Sales Channel Context: Resolve context token
    Sales Channel Context->>Cart: Load cart by token
Loading

Copilot AI changed the title [WIP] Add documentation for session lifetime in Shopware Document session, sales-channel context, and cart lifecycles with clear config boundaries May 27, 2026
@Isengo1989 Micha Hobert (Isengo1989) marked this pull request as ready for review May 29, 2026 09:17
Copilot AI review requested due to automatic review settings May 29, 2026 09:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds centralized documentation for how Shopware session, Store API context, persisted sales-channel context, and cart lifetimes relate while remaining independently configured.

Changes:

  • Adds a new lifecycle overview section to the session performance guide.
  • Adds a Mermaid sequence diagram showing how session, context, and cart data are resolved.
  • Adds a comparison table mapping lifecycle scope to the relevant configuration setting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guides/hosting/performance/session.md Outdated
Micha Hobert (Isengo1989) and others added 2 commits May 29, 2026 11:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Isengo1989
Copy link
Copy Markdown
Contributor

Marc (@cramytech) I adjusted the recommendation by CP. Here is a preview of the UML diagram

2026-05-29_11-24

Any additions you might think of ?

@Isengo1989 Micha Hobert (Isengo1989) added the Improvement PR created to append/modify info in the existing article label May 29, 2026
@cramytech
Copy link
Copy Markdown
Contributor

Marc (cramytech) commented May 29, 2026

Maybe the Shopware (recommended) default values, a link to the documentation where and how to set these vars and for the Frosh Tools maybe an info that the current php session/cookie settings do not match to the intended lifetime? I see quite a lot of installations where the php.ini defaults for session.gc_maxlifetime = 1440 are still applied.

@Isengo1989
Copy link
Copy Markdown
Contributor

Maybe the Shopware (recommended) default values, a link to the documentation where and how to set these vars and for the Frosh Tools maybe an info that the current php session/cookie settings do not match to the intended lifetime? I see quite a lot of installations where the php.ini defaults for session.gc_maxlifetime = 1440 are still applied.

Thanks. I will check what is recommended, but as always, this is very much depending on the need. Maybe lets go with mostly used.

We do not manage FroshTools https://github.com/FriendsOfShopware/FroshTools - maybe tinect (@tinect) Felix Schneider (@schneider-felix) could take a look.

@schneider-felix
Copy link
Copy Markdown
Contributor

If you find the time to create a PR for FroshTools, I'd be happy to merge it. I only skimmed over the topic but it sounds reasonable to me.

@Isengo1989
Copy link
Copy Markdown
Contributor

Maybe the Shopware (recommended) default values, a link to the documentation where and how to set these vars and for the Frosh Tools maybe an info that the current php session/cookie settings do not match to the intended lifetime? I see quite a lot of installations where the php.ini defaults for session.gc_maxlifetime = 1440 are still applied.

I added an info box and where to set those vars, but left recommendations out. They tend to be very customer specific, also had this experience with +15 shops I managed back in the day. But with that, there should be no more confusion.

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

Labels

Improvement PR created to append/modify info in the existing article

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs]: Missing Session Lifetime Documentation

5 participants