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

前端 未结 5 1389
遇见更好的自我
遇见更好的自我 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条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 06:12

    The site generates a unique token when it makes the form page. This token is required to post/get data back to the server.

    Since the token is generated by your site and provided only when the page with the form is generated, some other site can't mimic your forms -- they won't have the token and therefore can't post to your site.

提交回复
热议问题