Skip to content
Download

cookieName

mach::CsrfBuilder::cookieName

Sets the CSRF cookie name.

Sets the name of the cookie used to store the CSRF token.

CsrfBuilder& cookieName(std::string_view name);

A reference to the current CsrfBuilder instance.

Parameter Description
name The CSRF cookie name.

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

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