A composition comprising a polymer and at least one active agent, wherein the composition is formulated for topical application and shows thermally reversible behavior or inverse thermally reversible behavior. The active agent of the composition is an antimicrobial, an anti-inflammatory agent, anesthetic or mixtures thereof. A method of preparing the composition is also provided.