Session Service
A service to handle the Get, Update and Clearing of the Session
The session service is what creates and handles the creation, retrieval, updating and clearing of the UmbCheckout Basket within the .NET session.
You can access the session service by injecting ISessionService which can be found within the namespace UmbCheckout.Core.Interfaces
A shopper has one Basket per site root culture and currency (see Prices, Currencies and Baskets). The overloads without a culture or currency use the current page's.
Get
Gets the current UmbCheckout session from the .NET session (and, on licensed sites, from the cookie or database). A Basket whose checkout session has been paid is cleared and an empty one returned (see Payment Flow / Lifecycle).
Parameters:
siteRootCulture
Optional: the culture of the site root
currencyCode
Optional: the 3-letter ISO currency code of the Basket
Task<UmbCheckoutSession> Get();
Task<UmbCheckoutSession> Get(string? currencyCode);
Task<UmbCheckoutSession> Get(string? siteRootCulture, string? currencyCode);Update
Updates the current UmbCheckout session or create a new session if not found
Parameters:
basket
The Basket
Task<UmbCheckoutSession> Update(Basket basket);Clear
Clears the UmbCheckout session from the .NET session. Returns true when the Basket is still present afterwards.
Last updated