如何使用PHP内置的$ _SESSION来分隔codeigniter的会话系统? [英] How are codeigniter's session system seprated with PHP's built in $_SESSION?

查看:146
本文介绍了如何使用PHP内置的$ _SESSION来分隔codeigniter的会话系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如手册所述:


注意: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 urlencodeed.

推荐答案

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屋!

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