How do you create a Log In Button? [closed]

I am trying to create a basic chat website similar to FaceBook in the way that people communicate by messages and everyone has a homepage. How do sites create signup and login buttons for such a thing? Is it JavaScript that stores every user ID? Or do they use Python? What is the way to go with this? I am assuming that the open-source code cannot be stored on the website itself which means you need something else like a dictionary in Python.