1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00
This commit is contained in:
Gerasimos Maropoulos
2016-08-16 19:23:12 +03:00
parent ca2e46f1c3
commit 3beb292f4f
2 changed files with 27 additions and 11 deletions

View File

@@ -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)
}