One bit of advice I might suggest though is to consider the industry you end up working in: for instance those of us in companies targeting regulated industries tend to weather financial storms a bit better than others because the need to follow regulations doesn't fall away in fact if the behaviour of an industry is seen as a cause of a crash (here's looking at you, sub-prime lending) then regulation will increase and non-tech companies will want some way of implementing/monitoring/automating compliance with it.
It might not be sexy work, but it is relatively recession-safe work.
Though as others point out: networking, and just being good at working, and good at adapting to change, are important too. Even in a relatively safe position the cost cutting axe may fall (due to a slump in sales, or post-merger, etc.) and how well you work with the rest of the company or how key your experience & flexibility are seen as being, can be far more important than pure technical skill when it comes to keeping a safe distance from that blade.