The invention belongs to the field of immunotherapy and vaccines. More particularly, the invention relates to a pharmaceutical composition comprising nanoparticles being composed of macromolecules and linear polyethylenimine (1-PEI) or 1-PEI derivative, and a pharmaceutically acceptable solvent containing a sugar alcohol, as well as a method for the preparation thereof. Uses of said compositions are also provided.