- Go Web Development Cookbook
- Arpit Aggarwal
- 130字
- 2021-08-27 19:01:20
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.
推薦閱讀
- Application Development with Qt Creator(Second Edition)
- Web安全防護指南:基礎(chǔ)篇
- 從區(qū)塊鏈到Web3:構(gòu)建未來互聯(lián)網(wǎng)生態(tài)
- SD-WAN架構(gòu)與技術(shù)(第2版)
- 網(wǎng)絡(luò)的琴弦:玩轉(zhuǎn)IP看監(jiān)控
- 城市治理一網(wǎng)統(tǒng)管
- 物聯(lián)網(wǎng)長距離無線通信技術(shù)應(yīng)用與開發(fā)
- 網(wǎng)絡(luò)設(shè)計與應(yīng)用(第2版)
- 計算機網(wǎng)絡(luò)技術(shù)及應(yīng)用
- 大型企業(yè)微服務(wù)架構(gòu)實踐與運營
- 組網(wǎng)技術(shù)與網(wǎng)絡(luò)管理
- 精通SEO:100%網(wǎng)站流量提升密碼
- 智慧城市中的物聯(lián)網(wǎng)技術(shù)
- 一本書讀懂移動物聯(lián)網(wǎng)
- 走近2050:注意力、互聯(lián)網(wǎng)與人工智能