sessions
sessions copied to clipboard
Gin middleware for session management
Is it possible to range over the key/value pairs in session so I can log them?
When running the installation command, I receive the following error: `$ go get github.com/gin-contrib/sessions` `go get: github.com/gin-contrib/sessions@none updating to github.com/gin-contrib/[email protected] requires github.com/boj/[email protected]: verifying go.mod: github.com/boj/[email protected]/go.mod: malformed record data`
I want get like this session_K36NW244LA2GB23N2HEYVWGTERU2S52C7YNV3Q2SDQLF53SQLJIQ
Not sure if I'm looking at this correctly. Let's say I have a cookie store `"github.com/gin-contrib/sessions/cookie".NewStore(...)` and I set some options on it with `Options()`. The options are set to...
I can find the function about sentinel mode. please help
# github.com/gin-contrib/sessions/redis ..\..\..\..\go\src\github.com\gin-contrib\sessions\redis\redis.go:52:42: cannot use pool (type *"github.com/gomodule/redigo/redis".Pool) as type *"github.com/garyburd/redigo/redis".Pool in argument to redistore.NewRediStoreWithPool If you have this error, please refer to the following. first ur Go folder\github.com\gin-contrib\sessions\redis\redis.go 6...
package example import ( "fmt" "github.com/gin-contrib/sessions/redis" "github.com/gin-gonic/contrib/sessions" "github.com/gin-gonic/gin" ) func Session(c *gin.Context){ session := sessions.Default(c) store, _ := redis.NewStore(10, "tcp", "192.168.1.246:6379", "", []byte("secret")) session.Set("login_user",store) err:=session.Save() if err!=nil { fmt.Println(err) }...
![image](https://user-images.githubusercontent.com/22438643/80350041-b9b5cb80-88a2-11ea-844e-a1d186c7ac61.png) ![image](https://user-images.githubusercontent.com/22438643/80350072-c508f700-88a2-11ea-9aa7-35086be2b1a7.png)
``` func Logout(ctx *gin.Context) { session := sessions.Default(ctx) session.Clear() session.Save() ctx.Redirect(301,"/") } ``` I have this operation but still can get the session
https://github.com/gin-contrib/sessions/issues/65