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

Introduction

Sometimes, we would like to persist information such as user data at an application level rather than persisting it in a database, which can be easily achieved using sessions and cookies. The difference between the two is that sessions are stored on the server side, whereas cookies are stored on the client side. We may also need to cache static data to avoid unnecessary calls to a database or a web service, and implement error handling while developing a web application. With knowledge of the concepts covered in this chapter, we will be able to implement all these functionalities in a fairly easy way.

In this chapter, we will start with creating an HTTP session, then we will learn how we can manage it using Redis, creating cookies, caching HTTP responses, implementing error handling, and eventually end with implementing login and logout mechanisms in Go. 

主站蜘蛛池模板: 沛县| 永仁县| 陕西省| 淮安市| 离岛区| 新余市| 丹凤县| 射阳县| 苏尼特右旗| 大余县| 湾仔区| 堆龙德庆县| 保康县| 宁明县| 鄂州市| 宜宾市| 辽宁省| 松原市| 满城县| 西昌市| 屯留县| 关岭| 平乐县| 育儿| 清丰县| 桂东县| 青海省| 昔阳县| 三亚市| 新化县| 社会| 朔州市| 阿拉尔市| 徐州市| 津市市| 宁波市| 义乌市| 甘孜| 乌苏市| 永福县| 黔西|