Refactor and fix cookie handling
Refactor and fix cookie handling

Remove the setting of cookie domain attributes. Doing so was causing cookies to not be sent from Chrome to the server. Link to the issue on the Chromium project: https://code.google.com/p/chromium/issues/detail?id=56211.

Moved the code that sets auth headers to occur when there is a valid current session. Before this change the auth headers would not be set on the first redirect into a protected URL and were only set on subsequent requests.

chrisneave/FakeMinder