Right now I have this confusion whether I should store JWT Token in the session or not
Should I
-
Store it in Redis after Token creation has been made
// JWT TOKEN token := CreateToken(user) // Storing it in Gorilla Session + Redis s := sessions.Default(c) s.Set("token", token) s.Save()
So then take the token from the server instead from subsequent request from the request Header
s.Get("token")
// and to something with it
-
Pass the Token in Subsequent request so in every route that required The token
func login(c *gin.Context) { c.Getheader("Authorization") }
I'm using gin framework
Which approach is better session or subsequent request from user
Regards, Naufal