Skip to content

func (m *Manager) Destroy(ctx context.Conetxt,.....) doesn' work. #19

@qkrgksqkr

Description

@qkrgksqkr

I set session with init manager setting domain option.
it is sub domain.

manager := session.NewManager(
	session.SetCookieName(...),
	session.SetCookieLifeTime(...),
	session.SetExpired(int64(...)),
	session.SetStore(...),
	session.SetSessionID(...),
	session.SetDomain(*.testdomain.com),
)

And, When I destroy session call function 'Destroy(..)'
It dosen't work. It still exists that cookie however in server side , that cookie (= session) is removed.

Maybe I think it beacuase of this below logic

// Destroy a session
func (m *Manager) Destroy(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
......

**if m.opts.enableSetCookie {
	cookie := &http.Cookie{
		Name:     m.opts.cookieName,
		Path:     "/",
		HttpOnly: true,
		Expires:  time.Now(),
		MaxAge:   -1,
	}**

......

I think, It need to append
'Domain: m.opts.cookieName,'

please check this issue.

thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions