Preventing cross-site request forgery in Go web applications

It's a common practice to secure web applications from a malicious website, email, blog, instant message, or a program attacking a trusted site for which the user is currently authenticated to prevent unwanted action. We often call this cross-site request forgery.

Implementing cross-site request forgery in Go is fairly easy using the Gorilla CSRF package, which we will be covering in this recipe.

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.