会话如何工作? [英] How Session Works?

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

问题描述

任何人都可以向我解释会话在 PHP 中的工作原理.例如.3 个用户登录了 gmail.服务器如何识别这 3 个用户.这背后的内部流程是什么.

Any body can explain me how session works in PHP. for eg. 3 users logged into gmail. how the server identifies these 3 uers. what are the internel process behind that.

推荐答案

会话由两个组件组成,一个客户端会话 ID服务器端会话数据.客户端可以将会话 ID 作为 URL 参数、cookie 甚至 HTTP 标头发送到服务器.然后服务器使用这个会话 ID 来寻找合适的会话数据返回给客户端.

Sessions are made up of two components, a client-side session ID and server-side session data. Clients can send a session ID to the server as a URL param, cookie, or even HTTP headers. The server then uses this session ID to find the appropriate session data to return to the client.

您可以通过各种session_ 函数来调整会话行为.

You can tweak session behavior via the various session_ functions.

这篇关于会话如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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