don't beat yourself up for eating cookies...just makes you feel worse if you feel guilty for stuff.
it's good you managed to even get into work. i'm not working at the moment, but if i ever felt rubbish, i just wouldn't go in. so at least feel good you managed to get in today.
and now it's probably home time and you can curl up and watch eastenders or something!