非浏览器发送HTTP请求和PHP会话 [英] Non-browser sent HTTP request and PHP sessions

查看:147
本文介绍了非浏览器发送HTTP请求和PHP会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP是否能够与不使用浏览器与服务器通信的设备维护会话?我知道任何应用程序都能够遵守HTTP协议,但是对于像其在框架中由HTTP请求类组成的ActionScript3和Java之类的语言,它们是否为PHP发送必要的参数来保存会话,就像它使用浏览器一样?

Is PHP able to maintain a session with devices that aren't using a browser to communicate with the server? I know that any application is capable of adhering to the HTTP protocol, but for languages like Actionscript3 and Java that consist of HTTP request classes in their frameworks, do they send the necessary parameters for PHP to hold a session like it does with a browser?

推荐答案

任何HTTP客户端库都可以支持cookie(这是PHP在请求之间维护会话令牌状态的方式默认)。有些会自动处理cookie,有些会要求它在首选项中打开,有些会提供API来访问标题(包括cookie)。

Any HTTP client library can support cookies (which is how PHP maintains session token state across requests by default). Some will handle cookies automatically, some will require it to be turned on in a preference, some will just provide an API to access the headers (which include the cookies).

这篇关于非浏览器发送HTTP请求和PHP会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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