Joke Collection Website - Public benefit messages - How to design a secure user login function

How to design a secure user login function

1. The first step is to write the view code of the logged-in user, and then set the name property.

2. Then test the user login function. Note at this time, if there is no such user in the database, you will be prompted to the registration page, so that the user can log in after registration, as shown in the figure below.

3. Then quickly code the registered view and set the name attribute.

4. Then register the test user, and then pay attention to automatically jump to the login page after registration, as shown in the figure below.

5. The last step is to test the user registration, and then you can automatically jump to the login page after registration, and then log in, as shown in the figure below.