Skip to content

Instantly share code, notes, and snippets.

@aarmora
Created June 10, 2016 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarmora/c494dec69c94c534557391fe759d74ec to your computer and use it in GitHub Desktop.
Save aarmora/c494dec69c94c534557391fe759d74ec to your computer and use it in GitHub Desktop.
@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