CSRF token generation

前端 未结 9 930
清酒与你
清酒与你 2020-12-07 09:58

This is a question about generating CSRF tokens.

Usually I\'d like to generate a token based off of a unique piece of data associated with the user\'s session, and h

9条回答
  •  既然无缘
    2020-12-07 10:52

    Try base64_encode(openssl_random_pseudo_bytes(16)). https://github.com/codeguy/php-the-right-way/issues/272#issuecomment-18688498 and I used it for my form example in https://gist.github.com/mikaelz/5668195

提交回复
热议问题