-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
-
Start Iris with a UNIX socket listener:
l, _ := netutil.UNIX("/var/run/app.sock", 0666) app.Run(iris.Listener(l))
-
Use session middleware, e.g.:
sess := sessions.New(sessions.Config{ Cookie: "session_id", Expires: 24 * time.Hour, AllowReclaim: true, })
-
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!