reuse magic cookie, improve errors
Merge pull request #8 from presbrey/master

reuse magic cookie, improve errors