There were instances in the past where I logged in with my own credentials, but it showed me as a different user after logging in.
How does this usually happen?
There were instances in the past where I logged in with my own credentials, but it showed me as a different user after logging in.
How does this usually happen?
It depends on the code that's used to create this login form. You have to give us more information than this. Like, where, what code is being used, how did you log in and a code snippet of the backend would be very good, and so on.
But, here is some things that I felt in my mind that could be the cause:
The session is invalid in that way that you have another session id which is accidentally a session that another user owns. (If you are using a session)
Database is queried wrong - It selects the wrong username or id for some reason. Not very likely but it's possible.
A cookie is storing the login credentials and you accidentally logged in with that cookie.
This could be the reason too, Jak Gib mentioned in the comments below:
This can sometimes occur when web server caching is misconfigured. There was a large incident recently with Steam. Users who logged in where given the cached pages for other users which contained personal details, making it appear they had logged in as somebody else.
Well, that is all I can come up with as your question is not giving me very much information.
You could comment on my answer with more information and I can possible help you more :)