为什么在$ _SESSION时使用$ _POST? [英] why use $_POST when you have $_SESSION?

查看:105
本文介绍了为什么在$ _SESSION时使用$ _POST?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么特别的原因我还应该使用$ _POST吗?


另外,我正在阅读关于会话的混合内容。 php.net说你可以通过cookie或会话ID传播会话ID:
http://www.php.net/manual/en/ref.ses...sion.idpassing


好​​酷。


但是,简而言之,PHP没有提到这一点。保罗只是说

嘿,使用session_start(),你就在路上:

http://hudzilla.org/phpwiki/index.ph...s_and_sessions


我测试了它,它可以工作。


有人可以解释会话ID的作用吗?


谢谢!

解决方案

_POST?


另外,我正在阅读关于会话的混合内容。 php.net说你可以通过cookie或会话ID传播会话ID:
http://www.php.net/manual/en/ref.ses...sion.idpassing


好​​酷。


但是,简而言之,PHP没有提到这一点。保罗只是说

嘿,使用session_start(),你就在路上:

http://hudzilla.org/phpwiki/index.ph...s_and_sessions


我测试了它,它可以工作。


有人可以解释会话ID的作用吗?


谢谢!


会话ID只是服务器上存在的记录的关键字,并且这个记录包含你写的任何会话数据它。这意味着

提供相同会话ID的不同PHP页面将连接到服务器上的

相同会话数据。这是一个网页传递给另一个网页的方式。


BTW,


_POST和

Is there any particular reason I should still use $_POST?

Also, I''m reading mixed things about sessions. php.net says you can
propagate session IDs either via cookies or session IDs:
http://www.php.net/manual/en/ref.ses...sion.idpassing

OK cool.

However, PHP in a nutshell makes no mention of this. Paul just says
hey, use session_start() and you''re on your way:

http://hudzilla.org/phpwiki/index.ph...s_and_sessions

I tested it out, and it works either way.

Can someone please explain what the session ID does?

Thanks!

解决方案

_POST?

Also, I''m reading mixed things about sessions. php.net says you can
propagate session IDs either via cookies or session IDs:
http://www.php.net/manual/en/ref.ses...sion.idpassing

OK cool.

However, PHP in a nutshell makes no mention of this. Paul just says
hey, use session_start() and you''re on your way:

http://hudzilla.org/phpwiki/index.ph...s_and_sessions

I tested it out, and it works either way.

Can someone please explain what the session ID does?

Thanks!


The session ID is simply the key to a record which exists on the server, and
this record contains whatever session data you write to it. This means that
different PHP pages which provide the same session ID will connect to the
same session data on the server. This is the way that one web page passes is
state to another web page.

BTW,


_POST and


这篇关于为什么在$ _SESSION时使用$ _POST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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