PHP客户端可以设置$

编程入门 行业动态 更新时间:2024-10-07 17:29:39
本文介绍了PHP客户端可以设置$ _SESSION变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在任何情况下,客户端/用户/黑客都可以自行设置$_SESSION变量(不包括运行在服务器计算机上的恶意软件.我的主要意思是通过浏览器)?

Is there any scenario where a client/user/hacker can set $_SESSION variables themselves (excluding malicious software running on a server computer. I mostly mean via the browser)?

我问的原因是因为这个问题前几天问.从那时起,我对这个话题变得非常困惑,但是我对会话固定和劫持有了一个更好的主意.

The reason I ask is because of this question that I asked a few days ago. Since then I have become pretty confused on the subject, but I've got a better idea of session fixation and hijacking.

为了尽可能简单,如果我使用isset($_SESSION['validated'])之类的方法验证每个页面,它是否安全?

To put it as simply as possible, if I validate every page with something like isset($_SESSION['validated']), is it secure?

推荐答案

是的,如果您是直接将$_SESSION变量分配给未过滤的用户输入.

Yes if you were assigning $_SESSION variables directly to unfiltered user input.

这带给我了我的意思:从不信任用户的输入.永远

Which brings me to my point: NEVER TRUST INPUT FROM THE USER. EVER

如果确实要过滤输入,那么我不知道该怎么做.

If indeed you are filtering the input, then I don't see how it could be done.

更多推荐

PHP客户端可以设置$

本文发布于:2023-11-13 02:44:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583209.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!