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

Can't switch language if Coral is running on a non standard port #448

Closed
kfischer opened this issue Jul 2, 2018 · 2 comments
Closed

Can't switch language if Coral is running on a non standard port #448

kfischer opened this issue Jul 2, 2018 · 2 comments
Assignees
Labels
bug This is a bug (not an enhancement)

Comments

@kfischer
Copy link

kfischer commented Jul 2, 2018

When running Coral on a non-standard port, for example :9090, switching the language from English to another is not possible. When choosing another language from the pull down, the page reloads and jumps back to English instead of the language chosen.

This is because the lang cookie storing the selected language isn't set.

After some research the problem is that Coral tries to set the domain attribute of the cookie to the host including the port number. Instead it should be using the host name without the port.

Cookies do not provide isolation by port. If a cookie is readable by a service running on one port, the cookie is also readable by a service running on another port of the same server... (https://tools.ietf.org/html/rfc6265#section-5.1.3)

Test plan:

  • Configure Coral to run on another port, like 9090
  • Try to switch to another language than English from different modules and pages
  • Check that no lang cookie is stored
  • Apply the patch
  • Repeat the test plan and verify that the cookie is now set properly and switching the language works as expected
@kfischer
Copy link
Author

kfischer commented Jul 2, 2018

I am going to provide a pull request for this.

kfischer added a commit to kfischer/coral that referenced this issue Jul 2, 2018
…andard port

When running Coral on a non-standard port, for example :9090,
switching the language from English to another is not possible.
When choosing another language from the pull down, the page
reloads and jumps back to English instead of the language chosen.

This is because the lang cookie storing the selected language isn't set.

After some research the problem is that Coral tries to set the
domain attribute of the cookie to the host including the port
number. Instead it should be using the host name without the port.

Cookies do not provide isolation by port. If a cookie is readable
by a service running on one port, the cookie is also readable
by a service running on another port of the same server...
(https://tools.ietf.org/html/rfc6265#section-5.1.3)

Test plan:
- Configure Coral to run on another port, like 9090
- Try to switch to another language than English from different modules and pages
- Check that no lang cookie is stored
- Apply the patch
- Repeat the test plan and verify that the cookie is now
  set properly and switching the language works as expected
@veggiematts
Copy link
Contributor

See PR #449

@jeffnm jeffnm added the bug This is a bug (not an enhancement) label Jul 2, 2018
jeffnm added a commit that referenced this issue Jul 5, 2018
(issue #448) Can't switch language if Coral runs on a non-standard port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug (not an enhancement)
Projects
None yet
Development

No branches or pull requests

3 participants