kataras / kataras/iris

[BUG] session recreation results in no session at all

Open
#2,352 1 comment 0 reactions 1 assignee Claimed by @kataras View on GitHub
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**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:

```go
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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.