Login first... instead of doing it when you try to post. Better yet, login and click "remain logged in" box. Much easier than changing the code.