Skip to content
New issue

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

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

Already on GitHub? # to your account

can't remove session cookie? #2689

Closed
yahuian opened this issue Jun 6, 2023 · 2 comments
Closed

can't remove session cookie? #2689

yahuian opened this issue Jun 6, 2023 · 2 comments
Labels
enhancement help wanted planned This issue/proposal is planned into our next steps.

Comments

@yahuian
Copy link

yahuian commented Jun 6, 2023

1. What version of Go and system type/arch are you using?

go version go1.20.4 linux/amd64

2. What version of GoFrame are you using?

GoFrame CLI Tool v2.4.2, https://goframe.org
GoFrame Version: v2.4.2 in current go.mod
CLI Installed At: /home/anyh/.nvm/versions/node/v18.5.0/bin/gf
CLI Built Detail:
  Go Version:  go1.20.4
  GF Version:  v2.4.2
  Git Commit:  2023-06-02 11:44:48 99236fd93bf35cba5ecf0abae4c46fa5e5ff3912
  Build Time:  2023-06-02 11:54:24

3. Can this issue be re-produced with the latest release?

yes

4. What did you do?

I want remove session cookie after session remove

func (s *sSession) RemoveAll(ctx context.Context) error {
	req := g.RequestFromCtx(ctx)

	if err := req.Session.RemoveAll(); err != nil {
		return err
	}

	req.Cookie.Remove(req.Server.GetSessionIdName())

	return nil
}

5. What did you expect to see?

cookie will be removed by brower

6. What did you see instead?

The session cookie was not removed.

image

image

I think the probole is even i use req.Cookie.Remove(req.Server.GetSessionIdName()) , it will be rewritten by request.Cookie.SetSessionId(request.Session.MustId()) in ghttp_servier_handler.go file

@gqcn gqcn added enhancement help wanted planned This issue/proposal is planned into our next steps. labels Aug 22, 2023
@github-actions
Copy link

Hello @yahuian. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @yahuian。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


With the same attention, I can't find a place to modify the session id of the current user.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement help wanted planned This issue/proposal is planned into our next steps.
Projects
None yet
Development

No branches or pull requests

3 participants