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

quick_setup.pl: Include the SystemID in the name of the session cookie #3804

Closed
bschmalhofer opened this issue Sep 22, 2024 · 5 comments
Closed
Labels
documentation Improvements or additions to documentation question Further information is requested
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Sep 22, 2024

This is sometimes useful during development. Browsing two instances from the same domain is easy when the two instances run on differenent ports and different browsers are used. Using the same browser fails because the session cookies overwrite each other.

A simple solution could be to use unique name for the SessionName and CustomerPanelSessionName SysConfig properties. This could be added to bin/docker/quick_setup.pl . Or is there a better approach?

@bschmalhofer bschmalhofer added documentation Improvements or additions to documentation question Further information is requested labels Sep 22, 2024
@bschmalhofer bschmalhofer added this to the OTOBO 11.1 milestone Sep 22, 2024
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 24, 2024

In this case we want to pass an argument to the quick setup commant. This can be done with a shell function.

otobo_docker_quick_setup() {
    docker compose exec web bash -c "date ; hostname ; rm -f Kernel/Config/Files/ZZZAAuto.pm ; bin/docker/quick_setup.pl --db-password otobo_root --http-type http --http-port $1 --system-id $1 --activate-elasticsearch --add-user --add-admin-user --add-customer-user --add-calendar"
}

TODO:

  • append the session id to the session name in the SysConfig
  • test wether two installation can run side by side in the same browser
  • run the test suite as tests might depend on a specific value for the SystemID
  • Define a default value for the SystemID, maybe extract it from the .env file

@svenoe
Copy link
Contributor

svenoe commented Sep 25, 2024

I understand that the SystemID is in the ticketnumber, precisely for communication between systems, but what would be a reason for having it in the session name?

bschmalhofer added a commit that referenced this issue Sep 25, 2024
for setting the SystemID in the SysConfig
@bschmalhofer
Copy link
Contributor Author

That is for the case when two Docker based installations run on the same Docker host but on different ports. The two installation can coexist with only one problem. Let's assume that the two installations run on 1481 and 1482.

  1. Log into the 1481 installation works fine
  2. Log into the 1482 installation in a new tab works fine too
  3. Continue work in the 1481 tab breaks as the Cookie has been hijacked by the 1482 tab

bschmalhofer added a commit that referenced this issue Sep 25, 2024
for setting the SystemID in the SysConfig
@bschmalhofer
Copy link
Contributor Author

The last commits were actually for #3745. I'll rename the issue and mark the old issue as a duplicate. Sorry for causing confusion.

@bschmalhofer bschmalhofer changed the title Why is the SystemID not part of session string for Kernel::System::AuthSession::DB ? quick_setup.pl: Include the SystemID in the name of the session cookie Sep 25, 2024
@bschmalhofer
Copy link
Contributor Author

Renaming the session cookie seems to work fine. Using the shell function works as well, at least for my setup. Closing this issue.

bschmalhofer added a commit that referenced this issue Sep 26, 2024
Newer versions of quick_setup.pl append the SystemID to the cookie name.
This should not lead to test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants