When calling setSelectedTeam(), the stack-access cookie is not updated immediately.
The selected_team_id field inside the JWT payload within the cookie remains set to the old team ID.
Observed Behavior:
The application state might update, but the cookie retains the stale selected_team value.
This old value persists until the next login/session refresh.
This causes issues in parts of the app that rely on the cookie for team context (e.g., Middleware or Proxy), as they continue to see the previous team.
Expected Behavior:
Calling setSelectedTeam() should trigger a refresh of the stack-access cookie so that the JWT payload reflects the newly selected team immediately.