add SessionCookieMaxAge configuration for ghttp.Server

This commit is contained in:
John Guo
2021-01-11 20:06:09 +08:00
parent 6f5b0c393e
commit 8ee3793f8f
4 changed files with 47 additions and 19 deletions

View File

@ -8,6 +8,7 @@ import (
func main() {
s := g.Server()
s.SetSessionCookieMaxAge(0)
s.Group("/", func(group *ghttp.RouterGroup) {
group.GET("/set", func(r *ghttp.Request) {
r.Session.Set("time", gtime.Timestamp())