Session cookie with Phoenix LiveView
You can use phx-trigger-action
to make sure a form submit goes through http instead through the socket.
On the example below, when @trigger_submit
is true
then the form will be sumitted to the path Routes.user_session_path(@socket, :create)
, which will hit the controller and set the cookie: