Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSRF ¶
type CSRF interface { // Generate returns a CSRF token suitable for inclusion in a form Generate(http.ResponseWriter, *http.Request) string // Check returns true if the given token is valid for the given request Check(*http.Request, string) bool }
CSRF handles generating a csrf value, and checking the submitted value
func NewCookieCSRF ¶
NewCookieCSRF stores random CSRF tokens in a cookie created with the given options. Empty CSRF tokens or tokens that do not match the value of the cookie on the request are rejected.