Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize automatic login for seven days by php

Shulou Source: shulou.com Published: 2022-06-02 06:30:26 09月22日 Update

This article mainly explains "php how to achieve seven-day automatic login", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "php how to achieve seven-day automatic login"!

Php to achieve seven-day automatic login method: 1, create a new show.php file to achieve login page; 2, create function.php file to encrypt cookie;3, set user name and password judgment; 4, open session and achieve automatic login within a week.

This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.

How does php log in automatically for seven days?

PHP automatically logs in within a week:

1. Create four new files

Show.php

Test username and password automatic login

Function.php// encryption cookie

Here I use XOR encryption, because after two XOR, it will change back to the original value.

Run it.

Check the cookie.

Close the browser and open it again. Now it's time to read cookie.

Here is just to provide a way of thinking, the specific login verification has yet to be considered by the reader.

Thank you for your reading, the above is the content of "how to achieve seven-day automatic login of php". After the study of this article, I believe you have a deeper understanding of how to achieve seven-day automatic login of php, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Login password file user user name encryption learning login content idea method authentication just character is situation article time more browser Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL NVidia Xiaomi Apple Linux