lundi 9 novembre 2015

What happens when I log into a website/server?

Let me preface this by saying I don't know much about how the web or servers work.

I'm assuming that there are file(s) in external storage that holds the data for all created accounts for a particular website. They would hold things like usernames, encrypted passwords and other data, such as a 2-player game site keeping track of the ELO rating of each account.

But what happens when an account logs in? Is there something like an account object variable created in internal memory that is needed to interact with the user? I've read a little about tokens, are they like unique integer values assigned to logins that could be used to index an array?

I'm asking this because I need to make a project for a class that makes use of certain data structures. I thought that validating logins would be a good use of hashing.

Once their is a successful login, I'd fill the next empty array element with that users data, and the index would be their "token."

Then if I get a request from token X that he wants to be placed in a game, I'd insert his relative data into a binary search tree based on his skill ranking.

My project would entirely just be a simple console application with no actual online component. I'm wondering if what I just described would be a close simulation of how online interactions work, or If I should go about it a different way.

All responses greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire