Session secret key
This commit is contained in:
parent
aeb68a3b79
commit
5569a0b541
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -13,14 +13,14 @@ import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
const SessionHeader = "slide-session"
|
const sessionHeader = "slide-session"
|
||||||
|
|
||||||
func NewApp() *gin.Engine {
|
func NewApp() *gin.Engine {
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
|
||||||
store := sessions.NewCookieStore([]byte("secret"))
|
store := sessions.NewCookieStore([]byte("secret"))
|
||||||
r.Use(sessions.Sessions(SessionHeader, store))
|
r.Use(sessions.Sessions(sessionHeader, store))
|
||||||
|
|
||||||
r.LoadHTMLGlob("templates/*.tmpl")
|
r.LoadHTMLGlob("templates/*.tmpl")
|
||||||
r.Static("/static", "./static")
|
r.Static("/static", "./static")
|
||||||
|
|
Loading…
Reference in a new issue