4 years is not unreasonably long. If, when opened, the primer:
has no "skin" on top
has no mildew/mold growth
stirs up nicely
has no suspended solids/clumps
has no nasty/musty odor
then it is more than likely fine.
Yes, paint and primer are similar in that respect. You run the risk of having the primer not perform as designed when it's this old.
Why take the risk for your project? In return for saving a small amount of money today your entire project could be messed up and you'll be left with having to remove all the primer and paint and redoing the whole thing.