简体   繁体   English

PHP Lithium-身份验证如何访问会话数据

[英]PHP Lithium - Authentication how to access session data

I have read about authentication in Lithium manual, still I have some questions about it. 我已经在Lithium手册中阅读了有关身份验证的信息,但仍然有一些疑问。 After Auth::check ('default', $this->request) , it will return an array of user data if succeed. Auth::check ('default', $this->request) ,如果成功,它将返回一个用户数据数组。 I have finished this part according to the manual. 我已经按照手册完成了这一部分。

  1. if I want to save some of this array into session (not all of them), how to do it? 如果我想将此数组的一部分保存到会话中(不是全部),该怎么做?
  2. Are those data in session encrypted? 会话中的那些数据是否已加密? If not, how could I manipulate it, I want to encrypt it for security concern. 如果没有,我应该如何操作它,出于安全考虑,我想对其进行加密。

Thanks. 谢谢。

This should give you something to go on regarding encrypting session data - http://nitschinger.at/Session-Encryption-with-Lithium . 这应该使您可以继续进行有关加密会话数据的操作-http://nitschinger.at/Session-Encryption-with-Lithium

As far as telling Auth::check() which fields to save to the session: 据告诉Auth::check()哪些字段保存到会话中:

Auth::config(array(
   'default' => array(
       'session' => array(
           'persist' => array('username', 'email')
        )
    )
));

This is in the latest master, and there is more explanation at the top of security\\Auth.php . 这是最新的版本,在security\\Auth.php顶部有更多说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM