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

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.

主站蜘蛛池模板: 桐梓县| 九寨沟县| 兴化市| 施秉县| 德清县| 宜宾市| 精河县| 上栗县| 郸城县| 朝阳区| 调兵山市| 玉屏| 纳雍县| 扎赉特旗| 青海省| 象州县| 津南区| 遂溪县| 德清县| 玛纳斯县| 泾川县| 上栗县| 广南县| 紫云| 额尔古纳市| 江油市| 沛县| 从化市| 阳山县| 新巴尔虎左旗| 曲靖市| 呼伦贝尔市| 沂南县| 通海县| 宁城县| 青冈县| 揭东县| 漠河县| 颍上县| 榆树市| 龙江县|