Adding CSRFToken to Ajax request

后端 未结 9 2050
夕颜
夕颜 2020-11-27 05:40

I need to pass CSRFToken with Ajax based post request but not sure how this can done in a best way. Using a platform which internally checking CSRFToken

9条回答
  •  遥遥无期
    2020-11-27 06:18

    Everybody that using: var myVar = 'token', is probably the worst idea. I can print it dirrectly in the console. You need to encrypt on the client side, then decrypt on server side.

提交回复
热议问题