If it's not true, that would mean that Lincoln never kept his lunch in his hat. And how would anyone be able to verify that he never did so unless they personally observed what Lincoln did up until lunchtime every day of his life since the day he got his first hat?
Besides, he could probably carry a lot more food in that stovepipe than the guys in the Army could in their forage caps.