I had no problems securing the position I have now, and last year, while looking for full-time work, recruiters who were less than half my age were interviewing me, and i did get to some initial phone interviews. I didn't see any evidence of ageism - not from recruiters and not from companies interested in speaking initially on the phone with me.
I think what really helps is to be current in the technologies, be a self-starting continuous learner, never being afraid to try something new and different, and demonstrating exactly how you can add value to any employer or client who's interested in you. Knowing more than tech is hugely important: You have to have outstanding social and emotional skills as well.
I intend to program until my last day on this planet. Can't think of a better vocation and avocation - to start with a blank IDE screen and, after a few weeks or months, have an application working for a client or fielded in the market.
So, don't despair, focus on all the other experiences you've accumulated, and demonstrate - don't just tell about - your abilities and how hiring you would add value to any organization.