mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:16:28 +01:00
Set the session's configuration to a pointer
This commit is contained in:
parent
d04edb96bb
commit
b93ac27034
2
iris.go
2
iris.go
|
@ -220,7 +220,7 @@ func New(cfg ...config.Iris) *Framework {
|
||||||
engines: make([]*templateEngineWrapper, 0),
|
engines: make([]*templateEngineWrapper, 0),
|
||||||
}
|
}
|
||||||
//set the session manager
|
//set the session manager
|
||||||
s.sessions = newSessionsManager(c.Sessions)
|
s.sessions = newSessionsManager(&c.Sessions)
|
||||||
// set the websocket server
|
// set the websocket server
|
||||||
s.Websocket = NewWebsocketServer(s.Config.Websocket)
|
s.Websocket = NewWebsocketServer(s.Config.Websocket)
|
||||||
// set the servemux, which will provide us the public API also, with its context pool
|
// set the servemux, which will provide us the public API also, with its context pool
|
||||||
|
|
|
@ -252,13 +252,13 @@ type (
|
||||||
// sessionsManager implements the ISessionsManager interface
|
// sessionsManager implements the ISessionsManager interface
|
||||||
// contains the cookie's name, the provider and a duration for GC and cookie life expire
|
// contains the cookie's name, the provider and a duration for GC and cookie life expire
|
||||||
sessionsManager struct {
|
sessionsManager struct {
|
||||||
config config.Sessions
|
config *config.Sessions
|
||||||
provider *sessionProvider
|
provider *sessionProvider
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// newSessionsManager creates & returns a new SessionsManager and start its GC
|
// 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 {
|
if c.DecodeCookie {
|
||||||
c.Cookie = base64.URLEncoding.EncodeToString([]byte(c.Cookie)) // change the cookie's name/key to a more safe(?)
|
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:
|
// get the real value for your tests by:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user