如何使用PHP内置的$ _SESSION来分隔codeigniter的会话系统? [英] How are codeigniter's session system seprated with PHP's built in $_SESSION?
问题描述
如手册所述:
注意:Session类不使用本地PHP会话。它
生成自己的会话数据,为
开发人员提供更多的灵活性。
Note: The Session class does not utilize native PHP sessions. It generates its own session data, offering more flexibility for developers.
但是当我存储一些数据在 phpinfo()中使用
我可以在其中找到 $ this-> session-> set_userdata(array('sample_key'=>'sample_value'));
sample_key
和 sample_value
。
But when I store some data using $this->session->set_userdata(array('sample_key' => 'sample_value'));
, in phpinfo()
I can find sample_key
and sample_value
in that.
我希望部分
不使用本地PHP会话
does not utilize native PHP sessions
表示隐藏来自 phpinfo()
的会话变量。
to be meaning that it hides the session variables from phpinfo()
.
我一直认为这可能是一个安全缺失。是否可以?
I'd always thought that it might be a security lack. Could it be?
看起来这些值是 urlencode
ed。
As it seems, the values are urlencode
ed.
推荐答案
CodeIgniter的会话只是将数据存储在cookie中,并将其称为会话。
CodeIgniter's "session" just stores the data in a cookie, and calls it a session. Native PHP sessions store the data on the server, and a "sessionID" in a cookie.
在 phpinfo
中,本地PHP会话将数据存储在服务器上,并将sessionID您可以看到变量,但是会话,您看不到另一个用户的会话。
In phpinfo
, you can see the variables, but it's your session, you can't see another user's session.
这篇关于如何使用PHP内置的$ _SESSION来分隔codeigniter的会话系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!