Skip to content

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

Description

@kastmgnru

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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