When reloading “index.ex” page of LiveView, the “mount()” function is called.
def mount(params, session, socket) do
IO.inspect(socket.assigns, label: "ProductLive, mount, socket.assigns")
....
end
Why does liveview alway show that “current_user and session_id” is changed whenever reloading the web page? I think it’s been changed before reloading the page.
ProductLive, mount, socket.assigns: %{
__changed__: %{current_user: true, session_id: true},
current_user: #Pento.Accounts.User<
...
...
>,
flash: %{},
live_action: :index,
session_id: "users_sessions:SgWWssKFMaobcQmZCXPK9cm-X59ohwfw4_SFXOjEwiw="
}
Thank you for reading.