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

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.

主站蜘蛛池模板: 仁怀市| 酉阳| 汾西县| 虞城县| 乌审旗| 陆丰市| 兴隆县| 曲阜市| 崇礼县| 大丰市| 仁怀市| 申扎县| 宣城市| 富源县| 保亭| 阿图什市| 吐鲁番市| 广宗县| 库伦旗| 达日县| 定州市| 昭苏县| 仲巴县| 五指山市| 山东| 临西县| 华阴市| 湘阴县| 茌平县| 清流县| 新巴尔虎左旗| 重庆市| 泗洪县| 临漳县| 修文县| 凌云县| 衢州市| 敦煌市| 平阳县| 吉木萨尔县| 锦屏县|