I've slept @ JFK before. Got kicked out of the UA (or was it DL) terminal. I forgot which terminal I was directed to, but I wound up there and was land-side.
If I recall, there is an Au-Bon-Pain, and near there, a rest/seating area with continuous seating, which makes it possible to lay out. Just get there early, or else the rest of the late night travelers will have taken the spaces.
I believe it is T4... but not 100% certain.