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

[BUG]Session works incorrectly when meets the multi-level TLDs #1407

Closed
AlexPeiran opened this issue Dec 18, 2019 · 2 comments
Closed

[BUG]Session works incorrectly when meets the multi-level TLDs #1407

AlexPeiran opened this issue Dec 18, 2019 · 2 comments

Comments

@AlexPeiran
Copy link

iris version:V12.1.1
golang version:1.13.4
OS:Ubuntu 16.04 LTS

BUG Describtion:
The function "formatCookieDomain" in cookie.go does not work correctly when the top-level domain is multi-level.(such as: org.cn)
For example, my domain is "www.example.org.cn", if users access my website by the URL"www.example.org.cn", iris' session work correctly.But ,as we known, users can also access my website by the URL "example.org.cn". In this time , the function "formatCookieDomain" does not have expected output. It prases "example.org.cn" to "org.cn",so session id is refused by the browser.

@AlexPeiran AlexPeiran changed the title [BUG]Session works incorrectly when meet the multi-level TLDs [BUG]Session works incorrectly when meets the multi-level TLDs Dec 18, 2019
@kataras
Copy link
Owner

kataras commented Dec 19, 2019

Hello @AlexPeiran, thanks for the report. It should be fixed now, I tested it locally and it passes but you need to verify it, could you please try by downloading the master branch?

Run this terminal command on your project's directory (at the go.mod):

$ go get github.com/kataras/iris/v12@master

@AlexPeiran
Copy link
Author

Already verified. It works

github-actions bot pushed a commit to goproxies/github.com-kataras-iris that referenced this issue Jul 27, 2020
Former-commit-id: acd8d582aab7b278ea99d0f02d79a33a8b5ee86f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants