Home >Backend Development >PHP Tutorial >想请教下,把用户名放入session再把session id 放入 cookie,和直接把用户名放入 cookie 有啥区别?

想请教下,把用户名放入session再把session id 放入 cookie,和直接把用户名放入 cookie 有啥区别?

WBOY
WBOYOriginal
2016-06-23 13:11:421091browse

最近在做网站登录页面,看了很多关于安全登录的帖子,看到最多的方法是吧用户名放入session再把session id 放入 cookie。这和直接把用户名放入cookie有啥不一样啊?那不成这样就加密了?


回复讨论(解决方案)

cookie 在客户端
session 在服务端
从保护隐私上讲,显然后者优于前者

Statement:
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