Improve the cookie jar implementation and hook it up.