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

this is a bug?the cookie will be covered! #210

Open
taoshihan1991 opened this issue Dec 8, 2022 · 3 comments
Open

this is a bug?the cookie will be covered! #210

taoshihan1991 opened this issue Dec 8, 2022 · 3 comments

Comments

@taoshihan1991
Copy link

In a page with two image verification codes, the values of the two image verifications are stored using session, at which time the two verification codes will conflict, and the cookie of the first one will be covered by the second one, resulting in the first verification failing.

@taoshihan1991
Copy link
Author

In the same page, if there are two image verification code links, the cookie will conflict and cover each other, and the cookie stored by the later called image verification code will overwrite the one from the previous one.

@taoshihan1991
Copy link
Author

Shouldn't both of them be able to be stored in the session?

@typ431127
Copy link

This is caused by the path setting. Please set the path to /

	store, _ := redis.NewStoreWithDB(10, "tcp"))
	store.Options(sessions.Options{
		Path:   "/",
		MaxAge: 86400 * 90,
	})
	r.Use(sessions.Sessions("session", store))
		session.Set("uuid", u4.String())
		session.Options(sessions.Options{MaxAge: 86400 * 90, Path: "/"})
		session.Save()

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

2 participants