查看PHP的会话变量 [英] View php session variables

查看:102
本文介绍了查看PHP的会话变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道这是否属于这里或web应用......请在适当移动。

Not sure if this belongs here or at webapps... please move if appropriate.

我甚至不知道如果这样的事情是可能的,但有一个扩展或附加的或者Firefox或Chrome,将让我查看我所有的PHP会话变量的方式也有扩展,让您查看饼干?

I don't even know if such a thing is possible, but is there an extension or add-on for either Firefox or Chrome that would let me view all my PHP session variables the way there are extensions that let you view cookies?

推荐答案

Cookie是可在客户端,这样他们就可以从浏览器中可以看出。

Cookies are available on the client-side, so they can be seen from the browser.

结果
在另一方面,会话数据存储在服务器,并不会发送到客户端的(除非你写的一些code来做到这一点,当然)


On the other hand, session data is stored on the server, and never sent to the client (except you write some code to do just that, of course).

要转储变量的内容,如 $ _ SESSION ,您可以使用 的var_dump() 功能。
结果在开发服务器,可以安装 的Xdebug 扩展,以提高它的输出大大的(和许多其他的调试有关的东西,顺便说一句)

To dump the content of a variable, like $_SESSION, you can use the var_dump() function.
On a development server, you can install the Xdebug extension to enhance its output greatly (and lots of other debugging-related things, btw).

如果您不想污染您网页的HTML,你可以安装 FirePHP 扩展萤火虫,并使用相应的PHP库数据的(如变量转储)的给它。
结果
这将允许你的变量,如 $ _ SESSION ,将显示在Firebug的控制台。

If you don't want to pollute the HTML of your page, you could install the FirePHP extension to FireBug, and use the corresponding PHP library to send data (like dump of variables) to it.
This would allow your variables, like $_SESSION, to be displayed in firebug's console.

这篇关于查看PHP的会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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