Patient: How long are you immune to a virus that you have had?
Doctor: The immune system has both immediate as well as long term memory. When exposed to a certain virus the immune system is a ctivated and it launches a attack against the virus and also forms a memory for future protection.Thus theoritically speaking the immunity should stay for life. However it is important to note that viruses keep changing and even a slight change in their composition may render the immunity useless and thus may not protect. Thus as long as the virus remains the same , the immunity would last . I hope this helps.