开发者

Disallow 'Back' in Rails

开发者 https://www.devze.com 2023-03-08 03:28 出处:网络
I am creating a web application that asks user for randomized security question. However, when the user answer the initially given question incorrectly, the user can go back and try a different answer

I am creating a web application that asks user for randomized security question. However, when the user answer the initially given question incorrectly, the user can go back and try a different answer. Is there a way to make sure that the page will do a re-submission开发者_Python百科 when the user clicks the 'Back' button?


Dont fall back to javascript as a last resort, add an attempted boolean field to the question in the database and use that in your controller to ensure users are not just guessing at security questions.

If the user submits the form too many times for one question mark that as attempted and redirect them to another question.


Maybe you should do it with javascript because it's all in the browser... this could help: http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript

0

精彩评论

暂无评论...
验证码 换一张
取 消