How do I pass a session in a complete liveview app?

router

  scope "/", MyappWeb.Accounts do
    pipe_through :browser

    live "/signup", SignupLive
    live "/login", LoginLive
  end

  live_session :default, on_mount: MyappWeb.Accounts.UserLiveAuth, root_layout: {MyappWeb.Layouts, :root} do
    scope "/", MyappWeb.Home do
      pipe_through :browser
      live "/", HomeLive
    end
  end

login

  def mount(_params, _session, socket) do
    {:ok, assign(socket, form: to_form(%{"email" => ""}))}
  end
...
  def handle_info({:submit, "verified"}, socket) do
    {:noreply, push_navigate(socket, to: ~p"/", replace: true)}
  end

Need to pass user id in the session at ~p"/login" to the ~p"/" so I can extract user id

Basically do what put_session does but without the conn since I have no controllers only liveviews, need to pass the session of a login page to a live_session for the homepage, any way I can do that?
I tried looking at the :session option in the docs for live_session but i dont know how does that work since there arent any comprehensive examples in the docs

This is how we can get the user by token from session and assign it to a current_user in socket assigns.

I have a module Permit, that can be used for this purpose. (You can change the Permit live session from :anyone, to :must_be_logged_in or :must_be_verified or :must_be_admin)

router.ex

live_session :no_log_in_required,
    on_mount: [
      {DerpyToolsWeb.Permit, :anyone}
    ] do
    scope "/", DerpyToolsWeb do
      pipe_through :browser

      live "/", HomePageLive
    end
end

derpy_tools_web/live/permit.ex

defmodule DerpyToolsWeb.Permit do
  @moduledoc """
  Authentication code for live view pages. To restrict those pages to an admin, a normal user or anyone.
  """
  import Phoenix.LiveView
  use Phoenix.Component

  alias DerpyTools.Accounts

  def on_mount(:anyone, _params, session, socket) do
    socket =
      case find_current_user(session) do
        {:ok, user} ->
          %{"live_socket_id" => live_socket_id} = session

          socket
          |> assign_new(:current_user, fn -> user end)

        {:error, _} ->
          socket
          |> assign(current_user: nil)
      end

    {:cont, socket}
  end

  defp find_current_user(%{"user_token" => user_token}) do
    case Accounts.get_user_by_session_token(user_token) do
      nil -> {:error, nil}
      user -> {:ok, user}
    end
  end

  defp find_current_user(_), do: {:error, nil}
end