KO
|
EN
gitlite — search
Search
#javascript
#library
#nodejs
#css
#game
#animation
#hacktoberfest
#dotnet
#java
#golang
#epub
#cli
gin-sessions
★ 29
Open GitHub ↗
Session middleware for Gin.
Download README (.md)
Explore Similar Repositories
simple_kit
:
C实现的服务端开发框架
react-component-width-mixin
:
React mixin which sets width as state variable and updates as component changes shape
ftps
:
Implementation of the FTPS protocol for Golang.
Aruuz
:
No description available.
gitbook-plugin-gtoc
:
[Outdated] [Deprecated] 为GitBook生成目录结构
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
gin-sessions
?
Download (.md)
# gin-sessions [](https://travis-ci.org/tommy351/gin-sessions) Session middleware for [Gin]. ## Installation ``` bash $ go get github.com/tommy351/gin-sessions ``` ## Usage ``` go import ( "github.com/gin-gonic/gin" "github.com/tommy351/gin-sessions" ) func main(){ g := gin.New() store := sessions.NewCookieStore([]byte("secret123")) g.Use(sessions.Middleware("my_session", store)) g.GET("/set", func(c *gin.Context){ session := sessions.Get(c) session.Set("hello", "world") session.Save() }) g.GET("/get", func(c *gin.Context){ session := sessions.Get(c) session.Get("hello") }) } ``` [Gin]: http://gin-gonic.github.io/gin/