Use session cookies when following redirects

When a redirect was followed, only the cookies set by the initial
response were used in the follow-up request. Fixes #1228.