Easy login script without database

后端 未结 10 1935
说谎
说谎 2020-12-04 20:17

How do I create an easy login script that does not require a database. I would like it to be safe.

Alright, what about this script, i just made it by my knowledge in

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 21:00

    You can do the access control at the Web server level using HTTP Basic authentication and htpasswd. There are a number of problems with this:

    1. It's not very secure (username and password are trivially encoded on the wire)
    2. It's difficult to maintain (you have to log into the server to add or remove users)
    3. You have no control over the login dialog box presented by the browser
    4. There is no way of logging out, short of restarting the browser.

    Unless you're building a site for internal use with few users, I wouldn't really recommend it.

提交回复
热议问题