kataras / kataras/iris

[BUG] ShiftExpiration writes "invalid Cookie.Domain" error to log when running behind UNIX socket

Open
#2,565 0 comments 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**

When running an Iris application using a UNIX socket (e.g. /var/run/app.sock), invoking the sess.ShiftExpiration(ctx) function produces the following error in the logs, even though session and cookies otherwise work correctly:

`net/http: invalid Cookie.Domain "/var/run/app.sock"; dropping domain attribute`

**To Reproduce**

1. Start Iris with a UNIX socket listener:
`l, _ := netutil.UNIX("/var/run/app.sock", 0666)
app.Run(iris.Listener(l))`

2. Use session middleware, e.g.:
`sess := sessions.New(sessions.Config{
Cookie: "session_id",
Expires: 24 * time.Hour,
AllowReclaim: true,
})`

3. In any handler, call:
`sess.ShiftExpiration(ctx)
`

**Expected behavior**
No error should be written to logs; Iris should not attempt to use the UNIX socket path as a cookie domain.

**Desktop (please complete the following information):**
Go version: 1.24.4
OS: Linux
All requests go through nginx, with correct Host header forwarding.

**iris.Version**
v12.2.11

Thank you!

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.