什么是最好的方法来保护PHP中的登录Cookie数据? [英] What's the best method to protect login cookie data in PHP?

查看:141
本文介绍了什么是最好的方法来保护PHP中的登录Cookie数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP中创建一个登录系统,我想知道如何最好地保护我的cookie中的用户信息字符串。我在想用一个键加密字符串不知何故?这是最好的办法吗?

I'm creating a login system in PHP, and I want to know how to best protect the user information string in my cookie. I was thinking of encrypting the string with a key somehow? Is this the best way? I'm kinda new to this.

提前感谢。

推荐答案

p>不要在Cookie中存储敏感信息。存储会话ID哈希,以将登录用户与其帐户关联。

Don't store sensitive information in cookies. Store a session ID hash to connect the logged in user with their account.

这篇关于什么是最好的方法来保护PHP中的登录Cookie数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆