I think the yearly flu vaccine give you lifetime immunity against the strains you are vaccinated against. However flu strains change every year. (Hopefully that won’t be the case for covid!)
Officially, it gives you at least 6 months' worth of immunity, but, beyond that, there are no guarantees, and it generally fades over time.
That's why the recommendation is to wait until shortly before the onset of flu season to get vaccinated: If you get vaccinated in July, there's no guarantee that the vaccination will carry you through the worst of a (northern hemisphere) flu season.
That's why the recommendation is to wait until shortly before the onset of flu season to get vaccinated: If you get vaccinated in July, there's no guarantee that the vaccination will carry you through the worst of a (northern hemisphere) flu season.