Document session, sales-channel context, and cart lifecycles with clear config boundaries#2308
Document session, sales-channel context, and cart lifecycles with clear config boundaries#2308Copilot wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Marc (@cramytech) I adjusted the recommendation by CP. Here is a preview of the UML diagram
Any additions you might think of ? |
|
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. |
|
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. |
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. |

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.mdAdded UML sequence diagram (Mermaid)
Added config-to-behavior comparison table
framework.session.cookie_lifetimeframework.session.gc_maxlifetimeshopware.api.store.context_lifetimeshopware.sales_channel_context.expire_daysshopware.cart.expire_daysAdded concise risk/capacity guidance
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