Abstract : We investigate the production of charmonia in ultra-relativistic heavy-ion collisions. We first construct a two-component model of charmonium production, which includes (i) early hard J/psi production coupled with nuclear, Quark-Gluon Plasma and Hadron Gas suppression and (ii) statistical production of J/psi's by coalescence of c and cbar at the hadronization transition. Both components are evaluated within a common thermal evolution scenario. Available data on J/psi production at CERN-SPS and BNL-RHIC energies are reasonably well reproduced. We then improve our approach to account for in-medium effects on open and hidden charm states, inferred from recent lattice QCD results. Within a kinetic theory framework, we solve rate equations for charmonium abundances during the course of a heavy-ion collision. The survival of J/psi states above the phase transition temperature Tc favors their recreation in the QGP. In-medium effects in the hadronic phase, possibly linked to the (partial) restoration of chiral symmetry, largely resolve earlier identified discrepancies in the psi'/psi ratio.