Not sure how to structure your Go web application?
My new book guides you through the start-to-finish build of a real world web application in Go — covering topics like how to structure your code, manage dependencies, create dynamic database-driven pages, and how to authenticate and authorize users securely.
I’ve just released version 2 of SCS, a session management package for Go 1.11+. You can view it on GitHub.
Its design leverages Go’s context package to automatically load and save session data via middleware.
Importantly, it also provides the security features that you need when using server-side session stores (like straightforward session token regeneration) and supports both absolute and inactivity timeouts. The session data is safe for concurrent use.
A simple example
SCS supports a variety of different session stores:
I’d love to hear any feedback – either drop me an email or open an issue on GitHub.
If you enjoyed this article, you might like to check out my recommended tutorials list or check out my books Let's Go and Let's Go Further, which teach you everything you need to know about how to build professional production-ready web applications and APIs with Go.