Do sites store login password with hash? If so, can people can use hash collision to log in? I was researching about hash, and I thought, If sites store passwords with hash algorithms, then can't this happen:


User A has the password 'hello'
User B finds out the hash code of the password of user A 
User B knows the username of user A and uses hash collision to find a string with an identical hash
User B logs in the account of user A


So now, my main question is:
Do databases store the hash of the password or not? And if they do so, can the thing I wrote above happen?
Databases generally store hashed passwords (as they should), but some store it plaintext.  If someone were to find a hash collision that matched the stored, unsalted, and hashed password, then yes, they would be able to use that collision to login, because the client would send the password to the server, the server would calculate the hash and compare it to the one in the database. Since the two match (different input, same hashed value), login would  succeed. However, I might like to add, it's more computationally feasible that one would bruteforce the password as opposed to finding a collision, especially with the generally small size of a password.