#234 Moved the cookie stuff into beforeRender()