O'Reilly logo

Go Web Development Cookbook by Arpit Aggarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready…

As we have already created a session variable in our previous recipe using the Gorilla cookie store, we will just extend this recipe to save session information in Redis rather than maintaining it on the server.

There are multiple implementations of the Gorilla session store, which you can find at https://github.com/gorilla/sessions#store-implementations. As we are using Redis as our backend store, we will be using https://github.com/boj/redistore, which depends on the Redigo Redis library to store a session.

This recipe assumes you have Redis and Redis Browser installed and running locally on ports 6379 and 4567 respectively.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required