In my project, if the user has forgotten their password, I force them to write their user and using Javascript and windows.location
I open a new web page with a request type GET
and send your user as a variable. On this page, once the security question is answered, you can change your password.
After a review, I realized that this action opens a large security breach, because anyone can require this same web page and send a valid user, and if you know the answer to the security question, change the user's password.
I thought about sending a kind of security token, that only I know, but I can not think of something that is unique and unrepeatable, apart of course from the date or time.
If I write something in the HMTL, even if it is of hidden
, when reviewing the source code it can be seen, and the date or time would be very predictable, even if I modified them in some way, since it can be access the source code in JS.
It could be that he is not thinking very well about the solution and there is another way to do it. With all these details, is there any variable that is unique and unrepeatable that can generate with Javascript and decrypt with PHP?