A website login script is used to identify a user according to the user name and password he provides. Actually this identification restricts other users from accessing some particular pages. A simple example of explaining the necessity of login script is your email server. No one but you can access your email account with your unique login name and password.
Basically a login script may be of two types. (1). Single user login script and (2). Multi-user login script. A single user login script is one in which only one user can login and can access some particular pages. Example of such script is administrator control panel of a bulletin board, etc. In multi-user login script several users share same login page to identify themselves with different user name and password.
Design of a website login script entirely depends upon how much security requires restricting unwanted user in viewing the restricted pages. Consider the case of a blog site. There is a security restriction. Malicious users can't post any comment in the name of you. But the security level certainly much and much higher when a website dealing with the credit card number of their customers.
After successful login there must be some method to remember the user during its visiting session. Otherwise the user has to repeatedly verify him self when he try to move from one page to another. Some common and accepted methods of identifying user whether he already logged in are,
When user requests a restricted page the verification page first verify whether user is already logged in or not. If not verified he will be redirected to the login page. When user click on the logout link or when he leaves that site those login information may be deleted.