Rapid antigen clearance from the nasal mucosa is one of the major challenges in the development of intranasal vaccines. Here, we tested whether intranasal immunization with a chitosan-hydrogel vaccine, with in situ gelling properties, extended antigen retention time within the nasal mucosa. Intranasal immunization with a chitosan-hydrogel vaccine retained antigen within the upper respiratory tract (URT), while intranasal delivery of less viscous vaccines led to antigen accumulation within the lower airways. Interestingly, sustained antigen retention within the URT following chitosan-hydrogel vaccination boosted the number of vaccine-specific, tissue resident memory (Trm) CD8+ T cells that developed within the nasal mucosa. Mice immunized with a chitosan-hydrogel vaccine loaded with influenza virus peptides developed a large pool of influenza-specific CD8+ nasal Trm and these cells were highly protective during an influenza challenge. Our results describe an effective vaccine formulation that can be utilized to boost local immunity in the nasal mucosa.