"60 Minutes" recently ran a story about an innovative program underway in CT to fight discrimination against the long term unemployed. As with age discrimination and discrimination by gender, race, etc, this is illegal; however, that does not mean it does not exist and happening all the time.
Is such discrimination avoidable? Sure it is....How?....by keeping your skills current. Any potential employer is going to ask what you have been doing while you were out of work...and the answer is volunteering to keep your skills up as well as to learn new skills... taking classes...many free and online...and attending industry conferences. All of the above also provide networking opportunities...the best way to gain new employment.