I have a scenario where after logging in (and/or during a live session), a logged in user would be redirected to a page where they need to answer an identifying question, pulled randomly from a pool of ID questions, which the user has previously answered/saved on their profile (and are currently hidden from everyone's view, including the user/owner).
Example:
There are 4 questions on their profile which they've answered and saved:
What is the name of your first pet? - text field
What year were you born? - dropdown
What is your hair color? - dropdown
What city were you born in? - text field
One of these questions is pulled randomly and displayed on an independent page. If the user's answer matches the current value stored, then the user is redirected to a hidden "Success Page" which has a secret URL. If the user answers incorrectly (their answer does not match the one in the DB), then they are redirected to a "Fail Page", or a different question.
I'll need to pass on some variable to tell me which page they are originally coming from, in order to decide which "Success Page" or "Fail Page" they are redirected to.
I understand that this is not an effective security measure for logging in, since the user can simply navigate away from that page after logging in. However, in my use case, I am using it to redirect to a hidden URL, and not using it as a security measure for logging in.
These values will live on the user's profile as hidden, however, the user can delete them (reset security questions) and re-enter them if they choose to.
Please advise on the best/cleanest way to do this.
Thanks.