- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想使用 Lithium 的“cookie” session 适配器。用户登录后,我将使用他的散列密码创建一个 cookie。如果此 cookie 存在并且散列密码与数据库中的密码匹配,我将自动让他登录。
这样安全吗?
好吧,我不是在谈论 cookie 中的实际哈希值,而是加密的哈希值。我不想让任何人知道那个散列的样子 :)Lithium 具有“策略”,可以使用“ secret ”加密您存储在 session 中的任何数据,因此哈希将被加密。基本上我是在问 Lithium 的加密是否足够好。有人用过 Lithium 吗?
最佳答案
这取决于您的哈希算法。使用盐使您的散列更安全:
Safe Password Hashing和
Remember, the hash of the password is effectively the same as their password. Somebody who stole the hash would have the same access to the user's account as if they had stolen their password. Therefore it is not advisable to store a hash of the user's password in a cookie unless there was some other information not stored with the cookie that is used to authenticate (i.e. 2-factor authentication). Gabe in this Answer.
也可以查看这些链接:
Is it advisable to store a hashed password in a cookie?
Secure hash and salt for PHP passwords
关于php - 在 Lithium session 中存储密码安全吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14303993/
我想将配置数据存储在单独的文件中,并使用正确的 Lithium 方式加载/读取它。 最佳答案 取决于它的用途。我们非常不鼓励抛出全局配置,除非它被仔细管理。 如果它与连接到某种外部系统有关,我建议您查
我通读了锂\数据\模型\查询,但没有看到任何连接示例。 最佳答案 有多种方法可以执行与 Lithium 的连接。 Lithium 将为您处理已定义关系 ( examples in the manual
在 Lithium 中,像这样获取给定模型的所有行之后: $users = Users::all(); 我怎么知道返回了多少行?我正在使用 MySQL 连接器。 谢谢! 最佳答案 如果你只是想要计数
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 8 年前。 Improve this qu
我有一个扩展的基础模型。在其中,我定义了两个验证过滤器。一个检查记录是否唯一,另一个检查记录是否存在。它们的工作方式完全相同,只是一个返回值与另一个相反。 因此,将相同的代码编写两次只返回不同的值听起
我正在尝试通过 CLI 运行操作。操作是 UsersController::test() 所以,我运行这个:php libraries/lithium/console/lithium.php\\app
我正在尝试通过 CLI 运行操作。操作是 UsersController::test() 所以,我运行这个:php libraries/lithium/console/lithium.php\\app
这让我从 cakePHP 时代起就感到愤怒。如何查看 Model::find() 上执行的 SQL 查询? 最佳答案 这个问题已经在这里得到了回答:Lithium: Can we see querie
是否可以在 Lithium 的关系中访问多个模型? 例如,我有一个用户模型: class Users extends \lithium\data\Model { public $validat
我在 mongodb 中使用锂,我想知道下面的模型如何从 Posts::find('all'); 获取用户数据查询? 我必须执行两次查询吗? 感谢您的帮助! array('type' =>
如果我有一个我没有设置的锂应用程序,我该如何找出版本? 最佳答案 我认为他们不会在文件本身上加上时间戳。我建议您查看测试用例并查看最近的时间戳。 关于PHP lithium(li3) 如何找出版本,我
我对Lithium框架感到满意,并且想知道是否有用于将MongoDB或Memcache用于Lithium session 的示例。是否需要编写一个新的 session 适配器? 最佳答案 一种选择是将
我过去曾在几个项目中使用过 CakePHP,最近开始使用 Ruby on Rails,但我即将开始一个新项目,它需要 PHP。在使用 CakePHP 更新自己的同时,我了解到有一个名为 Lithium
我正在使用 Lithium 自定义组件来创建撰写最多博客文章的用户列表。我有一个用户列表,他们写了一篇博客文章,然后进行了一次休息,以获取每个用户所写的博客文章的数量。 Blog post
我有一个 MySQL 表 categories以下列: 编号 姓名 我使用检索数据 $categories = Categories::find('all'); 现在,我想创建一个 带有值为 $cat
我想排除调用 Lithium 模型的 find() 方法的结果。我需要为同时具有 MongoDB 和 MySQL 数据源的模型执行此操作,但在 SQL 中,我的意思是类似于 WHERE myfield
我正在使用 Lithium 和 mongoDB 编写我的第一个社区页面。我真的很喜欢 mongo 的无模式方式,但是有一个问题使得没有模式就无法工作: 例如我们有一个像这样的简单形式: form->c
我希望使用 Lithium 框架来构建我的应用程序配置界面,因为我喜欢它的最小方法和以文档存储(即 Mongodb)为中心的模型。 但是,(我知道它还没有完全发布),几乎没有任何信息、教程或示例可以让
我正在构建一个测试 Lithium 应用程序以了解它的工作原理,我发现表单助手似乎无法识别我传回的数据或任何验证错误。 目前我不得不手动传回我的错误,然后在 View 中处理它们。 Questions
我想使用 Lithium 的“cookie” session 适配器。用户登录后,我将使用他的散列密码创建一个 cookie。如果此 cookie 存在并且散列密码与数据库中的密码匹配,我将自动让他登
我是一名优秀的程序员,十分优秀!