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

前端 未结 5 1355
遇见更好的自我
遇见更好的自我 2020-11-22 05:39

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 y

5条回答
  •  一生所求
    2020-11-22 06:13

    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.

提交回复
热议问题