New state encoder/decoder and fixed 404 when logging in from login/register page.