Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qkrgksqkr opened this issue Jun 16, 2023 · 0 comments
Open

Comments

@qkrgksqkr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant