PHP Captcha without session

后端 未结 13 1876
傲寒
傲寒 2021-01-04 13:51

Ok, here is an issue: in the project i\'m working on, we can\'t rely on server-side sessions for any functionality.

The problem is that common captcha solutions fro

13条回答
  •  甜味超标
    2021-01-04 14:22

    The need for session or database comes from the need to coordinate the GET for the image with the html page containing it, so how about use the same code to embed a captcha image: [img src='data:image/jpeg;base64,...'], use a random salt to hash its text, then sending the random salt and hash together with the image to the client in a single GET?

    On postback you append the user text to the salt then compare the hashes. Just wondering how safe this would be...

提交回复
热议问题