Ageism is a thing but I don't think it is always due to the fact that you are "old". Companies turn old people away because they do not want to pay for "experience".
Why pay twice as much for an experienced developer when you can get a fresh new grad that is "just as productive"? Companies often ignore the fact that there is an experienced Senior Developer sitting in the corner telling that productive Junior Developer what pitfalls to avoid and how to get things done.