Home > Backend Development > PHP Tutorial > PHP用cookies自动登录该如何写

PHP用cookies自动登录该如何写

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:16:34
Original
776 people have browsed it

PHP用cookies自动登录该怎么写
初次登录的时候setcookie
第二次登录的时候该怎么进行判断?

------解决方案--------------------
cookie中写个标示符(比如login),比如login,然后在存用户名、密码等东西都存早cookie中,当然这些最好都加密,
if(isset($_COOKIE['login'])){
//读取数据库判断用户名密码是否正确
}
......

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template