So what does that login button really do?

Have you ever wondered what happens when you click the login button on a web site?

In most cases, your login (usually an email address) and password are checked against a database to make sure there is a match.

And what is a database? It’s simply a collections of records stored in a systematic way1; in this case, on the web server (the machine that displays the web site) or on a computer connected to it. A record could describe a person or a product, or news, or events. In this case, your record might contain your first name, your last name, perhaps the last time you logged in, as well as your email address and password.  The password is usually encrypted so that a hacker or  even the database administrator cannot easily see it.

Typical databases include Microsoft’s SQL Server (pronounced sequel server), Oracle’s database, and the open-source MySQL (pronounced my S Q L). Different programming languages have been designed to connect between the web page forms and the databases.  For SQL Server, ASP and ASP.NET are common, and for MySQL, PHP is most common.  There are many other languages and databases as well.  You can frequently tell the type of system by examining the file extension on the pages you see after you log in: .asp for ASP, .aspx for ASP.NET, and .php for PHP.

Once your login and password have been found in the database, you receive your additional privileges.  These could include

  • Access to private material
  • The ability to update your own record
  • The ability to add or edit other records, such as products
  • The ability to change the content of all the pages on the web site
  • Access to additional programs
  • The ability to communicate with fellow members of the website

In most systems, the fact that you have logged in to a particular web site is stored in a session variable in the browser, which lasts until all the browser windows (for that type of browser) are closed or perhaps until some time limit has been reached.  This explains why you can switch back to public parts of the web site or even other web sites and then return to the privileged parts without having to log in again.

1 http://en.wikipedia.org/wiki/Database, accessed, 11/5/2007