Fix cookies to actually persist properly.
Cookies should persist on scheme + "://" + authority. Remove the path and query.
Add tests.

Change-Id: I9fec6b43616319b78ff500f41b51c5ad0ecbd633