Redirect cookies

Cookies that were set during redirects were being lost. This broke the "set session cookie and redirect" login pattern. This patch should fix it.