Skip to content

session

silsuer edited this page Aug 20, 2018 · 1 revision

Bingo使用 gorilla/sessions 管理session,具体用法如下:

   func Index(c *bingo.Context) {
   	// 设置一个session
   	c.Session.Set("name","silsuer")
   	// 读取一个session
   	fmt.Fprintln(c.Writer,c.Session.Get("name"))
   }

Clone this wiki locally