官术网_书友最值得收藏!

Creating your first HTTP session

HTTP is a stateless protocol, which means each time a client retrieves a web page, the client opens a separate connection to the server and the server responds to it without keeping any record of the previous client request. So, if we want to implement a mechanism where the server knows about a request that the client has sent to it, then we can implement it using a session.

When we are working with sessions, clients just need to send an ID and the data is loaded from the server for the corresponding ID. There are three ways that we can implement this in a web application:

  • Cookies
  • Hidden form fields
  • URL rewriting

In this recipe, we will implement a session using HTTP cookies.

主站蜘蛛池模板: 屯门区| 桐庐县| 都兰县| 娱乐| 麟游县| 抚松县| 吴堡县| 平舆县| 花莲县| 乌拉特后旗| 建始县| 井陉县| 来凤县| 孝感市| 乃东县| 乌拉特后旗| 定边县| 通州区| 罗源县| 平昌县| 大埔区| 汽车| 内丘县| 荃湾区| 玛曲县| 建宁县| 台南县| 光泽县| 泰宁县| 昌宁县| 北流市| 临清市| 法库县| 奇台县| 双桥区| 左贡县| 济源市| 龙游县| 鄂尔多斯市| 闸北区| 万载县|