Skip to content

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

Open
@mblaschke

Description

@mblaschke

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

  • v12.2.9
  • v12.2.10-0.20240114045817-70882914d445 (main)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions