The session ID generation and redirection logic was moved from OnInitialized to OnAfterRenderAsync to address issues with NavigationException during SSR prerendering. OnInitialized is now intentionally left empty, and the new OnAfterRenderAsync method ensures the session ID is appended to the URL only after the first interactive render, when SignalR is connected and NavigateTo is safe.