Skip to content
Download

headerName

mach::CsrfBuilder::headerName

Sets the CSRF header name.

Sets the name of the HTTP header used to provide the CSRF token.

CsrfBuilder& headerName(std::string_view name);

A reference to the current CsrfBuilder instance.

Parameter Description
name The CSRF header name.

This method is not thread-safe and should only be called during CSRF configuration.

csrf.headerName("X-CSRF-Token");
Name Description
cookieName Sets the CSRF token cookie name.