Whenever we need to pass on the user data from one HTTP request to another, we can make use of HTTP sessions, which we will be covering in this recipe.
Creating your first session variable
Getting ready...
This recipe assumes you have Redis installed and running locally on port 6379.
How to do it...
- Install the github.com/astaxie/beego/session/redis package using the go get command, as follows:
$ go get -u github.com/astaxie/beego/session/redis
- Move to $GOPATH/src/my-first-beego-project/controllers and create sessioncontroller.go, where we will define handlers which...