1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 02:40:17 +00:00

set session.managerconfig public

This commit is contained in:
maxin
2016-08-13 21:07:27 +08:00
parent ce6f19871c
commit ef0d3d80dc
5 changed files with 43 additions and 33 deletions

View File

@ -15,6 +15,7 @@
package session
import (
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
@ -22,7 +23,12 @@ import (
)
func TestMem(t *testing.T) {
globalSessions, _ := NewManager("memory", `{"cookieName":"gosessionid","gclifetime":10}`)
config := `{"cookieName":"gosessionid","gclifetime":10, "enableSetCookie":true}`
conf := new(ManagerConfig)
if err := json.Unmarshal([]byte(config), conf); err != nil {
t.Fatal("json decode error", err)
}
globalSessions, _ := NewManager("memory", conf)
go globalSessions.GC()
r, _ := http.NewRequest("GET", "/", nil)
w := httptest.NewRecorder()