admin login scripts set


This set contains 3 ready-to-use admin login scripts using 3 different authentication methods:

  1. HTTP Authentication;
  2. Cookies;
  3. Sessions.

All the three provide the same security level and do not require any DB.

Minor differences: in cookie version you can also specify the number of days to keep your cookie alive while in other two versions the session will expire when you close your browser window, and in HTTP Authentication version there is no real logout but just a redirection to the root folder while there is no way to unset server globals from within the script - you will be logged out automatically as soon as you close the browser window to terminate the session.


  1. Open appropriate login.php in any text editor and specify your username/password.
  2. Upload login.php and demo.php to a subfolder on your server you want to protect.
  3. Open demo.php in your browser:
  4. If everything works, add to ALL your php scripts in protected subfolder:
    directly after <?php opening directive.
  5. Remove demo.php from your server.

Online DEMO

Use the following credentials for testing all the three DEMOS:

Username: admin
Password: password


Download the entire set (7kb).

Valid XHTML 1.0 Strict Valid CSS!