From b93ac270347afb364d73364d52befa88f13cbdf2 Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Tue, 19 Jul 2016 06:19:37 +0300 Subject: [PATCH] Set the session's configuration to a pointer --- iris.go | 2 +- sessions.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iris.go b/iris.go index 88c9a043..bf62a786 100644 --- a/iris.go +++ b/iris.go @@ -220,7 +220,7 @@ func New(cfg ...config.Iris) *Framework { engines: make([]*templateEngineWrapper, 0), } //set the session manager - s.sessions = newSessionsManager(c.Sessions) + s.sessions = newSessionsManager(&c.Sessions) // set the websocket server s.Websocket = NewWebsocketServer(s.Config.Websocket) // set the servemux, which will provide us the public API also, with its context pool diff --git a/sessions.go b/sessions.go index b598eca4..95b38b8a 100644 --- a/sessions.go +++ b/sessions.go @@ -252,13 +252,13 @@ type ( // sessionsManager implements the ISessionsManager interface // contains the cookie's name, the provider and a duration for GC and cookie life expire sessionsManager struct { - config config.Sessions + config *config.Sessions provider *sessionProvider } ) // newSessionsManager creates & returns a new SessionsManager and start its GC -func newSessionsManager(c config.Sessions) *sessionsManager { +func newSessionsManager(c *config.Sessions) *sessionsManager { if c.DecodeCookie { c.Cookie = base64.URLEncoding.EncodeToString([]byte(c.Cookie)) // change the cookie's name/key to a more safe(?) // get the real value for your tests by: