For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Every method also has an overload that takes a CancellationToken as its last parameter. Call that one: the overloads without a token are [Obsolete]. See Cancellation Tokens.

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:

Name
Detail

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:

Name
Detail

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