mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 21:15:56 +00:00
This commit is contained in:
@@ -332,7 +332,8 @@ func (m *sessionsManager) start(ctx *Context) *session {
|
||||
if cookieValue == "" { // cookie doesn't exists, let's generate a session and add set a cookie
|
||||
sid := m.generateSessionID()
|
||||
session = m.provider.init(sid)
|
||||
cookie := fasthttp.AcquireCookie()
|
||||
//cookie := fasthttp.AcquireCookie() strange errors when c.SetFlash (old)
|
||||
cookie := &fasthttp.Cookie{}
|
||||
// The RFC makes no mention of encoding url value, so here I think to encode both sessionid key and the value using the safe(to put and to use as cookie) url-encoding
|
||||
cookie.SetKey(m.config.Cookie)
|
||||
cookie.SetValue(sid)
|
||||
@@ -376,7 +377,6 @@ func (m *sessionsManager) start(ctx *Context) *session {
|
||||
} // if it's -1 then the cookie is deleted when the browser closes
|
||||
|
||||
ctx.SetCookie(cookie)
|
||||
fasthttp.ReleaseCookie(cookie)
|
||||
} else {
|
||||
session = m.provider.read(cookieValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user