  The interaction of gamma-ray burst (GRB) jets with the dense media into which
they are launched promote the growth of local hydrodynamic instabilities along
the jet boundary. In a companion paper we study the evolution of hydrodynamic
(unmagnetized) jets, finding that mixing of jet-cocoon material gives rise to
an interface layer, termed jet-cocoon interface (JCI), which contains a
significant fraction of the system energy. We find that the angular structure
of the jet + JCI, when they reach the homologous phase, can be approximated by
a flat core (the jet) + a power-law function (the JCI) with indices that depend
on the degree of mixing. In this paper we examine the effect of subdominant
toroidal magnetic fields on the jet evolution and morphology. We find that weak
fields can stabilize the jet against local instabilities. The suppression of
the mixing diminishes the JCI and thus reshapes the jet's post-breakout
structure. Nevertheless, the overall shape of the outflow can still be
approximated by a flat core + a power-law function, although the JCI power-law
decay is steeper. The effect of weak fields is more prominent in long GRB jets,
where the mixing in hydrodynamic jets is stronger. In short GRB jets there is
small mixing in both weakly magnetized and unmagnetized jets. This result
influences the expected jet emission which is governed by the jet's morphology.
Therefore, prompt and afterglow observations in long GRBs may be used as probes
for the magnetic nature at the base of the jets.
