In a LiveView, what is stored in the data-phx-session attribute on the LiveView. Ours are getting huge

Hi everyone

We’ve got a rather heavy SPA written with LiveView. The main “window” is a LiveView, and for historical reasons some of the nested components in there are also LiveViews. The nested LiveViews are using the same channel as the outer main LiveView, by calling the `join()` function in JS (the nested LiveViews are WebComponents, so that happens in the `connected` callback).

Now we’ve noticed that the `data-phx-session` attributes are getting huge, we are talking about 300kB in size. After a closer inspection we’ve come to the conclusion that the content of the `session` param to the ` mount` call of the LiveView is stored in there, and we did include the full user struct there. So we removed that, the other session params are just some integers, and the `data-phx-session` attribute did shrink significantly. However they are still very large, like 150-200 kB each.

Is there something else stored in there, maybe something related to the nested LiveViews?

Any help is appreciated :smiley: