在浏览器中查看和更改会话变量 [英] View and change sessions variables in a browser

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

问题描述

调试一个PHP程序,是否有可以查看会话变量(这些PHP $ _SESSION [foobar])的浏览器的附加/插件?


解决方案

没有办法操纵存储在会话中的值来自客户端。



这是您在Cookie上使用会话的主要原因之一 - 您可以控制数据。
使用Cookie,用户可以操纵数据。



从客户端访问/处理会话数据的唯一方法是使用Ajax调用或其他JavaScript机制来调用另一个php脚本,它将通过 session _ 功能。


Debugging a PHP program, is there any add-on/plug-in for browser which I can view sessions variables (those PHP $_SESSION["foobar"] )?

Best if I can change the value in the variables.

解决方案

There is no way to manipulate the values stored in sessions from the client side.

That's one of the main reasons you'd use a session over a cookie - YOU control the data. With cookies, the user can manipulate the data.

The only way to access/manipulate session data from the client side would be with an Ajax call or other JavaScript mechanism to call another php script, which would be doing the retrieval/manipulation of the session data via the session_ functions.

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

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