Alex Rivera | Logout

What is a CSRF token? What is its importance and how does it work?

Asked 2011-03-05T22:17:07.550
912

I am writing an application (Django, it so happens) and I just want an idea of what actually a "CSRF token" is and how it protects the data.

Is the post data not safe if you do not use CSRF tokens?

Edit
Report

1 Answer

11

The root of it all is to make sure that the requests are coming from the actual users of the site. A csrf token is generated for the forms and Must be tied to the user's sessions. It is used to send requests to the server, in which the token validates them. This is one way of protecting against csrf, another would be checking the referrer header.

answered 2011-03-05T23:11:50.640

Your Answer