A multi-user login script is a software system where many users can login with their unique login name and password and access protected area of that system. This protected area may be common to all users or may be user specific. All though a multi-user login script used in any software application but here I'm going to discuss the principle of working of login script used in internet world.
The basic principle of working of a multi-user login script used in websites is as follows.
The mechanism by which server remember the login session of a user depends upon the level of security it requires to prevent any unauthorized access of restricted area. For example website which deals with online money like PayPal offers much tighter security of login session than a bulletin board where registered user only can post a message in the board. Here I discuss few common techniques to hold a login session.
After a successful login server holds one or more reference values about the user session. Whenever user trying to access a protected area server verifies those references before access and if not satisfied it redirects user into the login page. Thus the session security entirely depends upon the following factors.
For a simple login system where security is not a consideration al all assigning a session or cookie of constant value is enough to validate session. At the end of the session life of those variables will normally expire. Security may be somehow extended by replacing the fixed value with the user IP address. But a good login system should record the following references about the login session and stores them in a secured database.
An encrypted copy of that session code is also saved as cookie. When browser requests WebPages from the server it also sends the previously saved cookie too. Then the server can validate that cookie value with the reference stored in its database.