Yes, but does the immunity to the flu after you’ve had it quit after a few months?
Yes, because the flu mutates and change all the time.
Yes it does, because Influenza is a highly unstable set of viruses with multiple strains. That’s also why the flu shot is only typically 40-60% effective: the flu changes while the shots are being produced. The third generation vaccines (mRNA platform) hold promise to fix that since they can be rapidly adjusted and mass produced. We can finally get ahead of Influenza.
Also, the immunity doesn’t technically “quit”. What happens is that the structures that trigger an immune response change with genetic drift. When you become infected, your dendritic cells take samples of the invader to the lymph nodes where T-cells and B-cells are produced to combat it. If the samples don’t look the same because the invader has changed enough since the last time you got infected, that process has to restart from scratch.