I’m thinking that one approach could be to buffer traces, logs, metrics in the browser until the user authenticates. I know that this would not be appropriate for some web apps, e.g. where user’s do not login, but in many cases it seems like a good approach. In scenarios where a user has a cookie already set it would not need to be buffered, but in reality a little buffering is likely a good thing.
There would need to be limits placed to avoid buffering too much data and either a rolling window of data to remove the oldest data as the buffer becomes full, or stop adding data after a certain point.