kataras / iris

The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket:
https://www.iris-go.com
BSD 3-Clause "New" or "Revised" License
25.24k stars 2.47k forks source link

[BUG] session recreation results in no session at all #2352

Open mblaschke opened 9 months ago

mblaschke commented 9 months ago

Describe the bug I've updated from iris v12.2.7 and v12.2.8 to v12.2.9 and session recreation results in no session (set-cookie header is there but sets an empty value)

To Reproduce

using following code to recreate the session:

func (c *Server) recreateSession(ctx iris.Context, cookieOptions ...context.CookieOption) *sessions.Session {
    c.session.Destroy(ctx)
    return c.startSession(ctx, cookieOptions...)
}

func (c *Server) startSession(ctx iris.Context, cookieOptions ...context.CookieOption) *sessions.Session {
  s := c.session.Start(ctx, cookieOptionList...)
  return s
}

header fist call:

Set-Cookie: app-sid=920c2e16-b645-45be-b22f-172fade5457c; Path=/; Expires=Sun, 14 Jan 2024 20:03:05 GMT; Max-Age=7199; HttpOnly; SameSite=Lax

header session recreation:

Set-Cookie: app-sid=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=0; HttpOnly

Expected behavior Old Session should be terminated, a new one should be created and session cookie should be set to new id

iris.Version

mblaschke commented 8 months ago

same with v12.2.10