This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

CookieXSRFStrategy

XSRFConfiguration sets up Cross Site Request Forgery (XSRF) protection for the application using a cookie. See https://www.owasp.org/index.php/Cross-SiteRequest_Forgery(CSRF) for more information on XSRF.

See more...

Deprecated: see https://angular.io/guide/http

      
      class CookieXSRFStrategy implements XSRFStrategy {
  constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
  configureRequest(req: Request): void
}
    

Description

Applications can configure custom cookie and header names by binding an instance of this class with different cookieName and headerName values. See the main HTTP documentation for more details.

Constructor

constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
      
      constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
    

Parameters

_cookieName

Type: string.

Optional. Default is 'XSRF-TOKEN'.

_headerName

Type: string.

Optional. Default is 'X-XSRF-TOKEN'.

Methods

configureRequest(req: Request): void
      
      configureRequest(req: Request): void
    

Parameters

req

Type: Request.

Returns

void