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

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.

主站蜘蛛池模板: 仙游县| 青川县| 马尔康县| 四平市| 霞浦县| 虹口区| 公主岭市| 靖远县| 松溪县| 宽甸| 甘孜县| 开封市| 聂荣县| 新河县| 崇州市| 忻州市| 华容县| 石楼县| 万源市| 永州市| 阆中市| 疏附县| 武强县| 霞浦县| 九江县| 琼结县| 拜城县| 察哈| 佛坪县| 城步| 鄯善县| 永寿县| 蓬安县| 阳谷县| 维西| 波密县| 泾川县| 石河子市| 南部县| 呼伦贝尔市| 慈溪市|