Do you prefer to store confirm password property in database? I am designing a database and it has came to my mind to check entered password (for register page) with confirmed password in database as well as in programming layer.
Do you recommend it?
Any comments would be appreciated.
Maybe I misunderstood your question, but let's consider a signup form. It is customary to ask for password confirmation, then when the user submits the form, the backend checks that both password fields do match. If there was some issue like incomplete data, you show a message back to the user.
Otherwise, if no other errors were found, you proceed to save the record to the DB - the password of course should be hashed and not stored in plain text.
But until the form is submitted without errors, you save nothing to the DB. At least I don't see why you would.
You can save session state though, that's what cookies are for.
To sum up, only one field is need for the password (in hashed form). The password confirmation field is simply to minimize the risk of incorrect input, but it's no longer useful after signup has completed.