#6 Data storage and session An important topic in web development is providing good user experience, but HTTP is stateless protocol, how can we control the whole process of viewing web sites of users? The classic solutions are using cookie and session, where cookies is client side mechanism and session is saved in server side with unique identifier for every single user. Noted that session can be passed in URL or in cookie, or even in your database which is much safer but it may drag down your application performance.
In section 6.1, we are going to talk about differences between cookie and session. In section 6.2, you'll learn how to use session in Go with a implementation of session manager. In section 6.3, we will talk about session hijack and how to prevent it when you know that session can be saved in anywhere. The session manager we will implement in section 6.3 is saving session in memory, but if we need to expand our application that have requirement of sharing session, we'd better save session in database, and we'll talk more about this in section 6.4.
##Links
- Directory
- Previous Chapter: Chapter 5 Summary
- Next section: Session and cookies