Skip to content

Commit

Permalink
#4469 Initialize session id cookie on server path
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Feb 6, 2025
1 parent 9240e16 commit 92557d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Csla.Blazor/State/StateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ namespace Csla.Blazor.State
/// <summary>
/// Get and save state from Blazor pages.
/// </summary>
/// <param name="sessionIdManager"></param>
/// <param name="sessionManager"></param>
public class StateManager(ISessionManager sessionManager)
public class StateManager(ISessionIdManager sessionIdManager, ISessionManager sessionManager)
{
private readonly ISessionManager _sessionManager = sessionManager;

Expand All @@ -41,10 +42,11 @@ public Task InitializeAsync(TimeSpan timeout)
/// <param name="timeout">Time to wait before timing out</param>
private async Task GetState(TimeSpan timeout)
{
Session session;
var isBrowser = OperatingSystem.IsBrowser();
if (isBrowser)
session = await _sessionManager.RetrieveSession();
_ = await _sessionManager.RetrieveSession();
else
_ = sessionIdManager.GetSessionId();
}

/// <summary>
Expand Down

0 comments on commit 92557d0

Please sign in to comment.