Created
June 10, 2016 18:35
-
-
Save aarmora/c494dec69c94c534557391fe759d74ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class AccountService { | |
constructor( | |
private http: Http) { | |
// This allows the cookie to be set and sent. | |
// It appears that once the cookie is set with login, it works for each call (even in other services) | |
let _build = (<any>http)._backend._browserXHR.build; | |
(<any>http)._backend._browserXHR.build = () => { | |
let _xhr = _build(); | |
_xhr.withCredentials = true; | |
return _xhr; | |
}; | |
} | |
// Other stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment