Skip to content

Commit

Permalink
[Readme] Add instructions for multiple applications on same domain (p…
Browse files Browse the repository at this point in the history
…imcore#17699)

* add instrcutions for multiple applications on same domain

* Create 08_Multi_Application_Setup.md

* Update 08_Multi_Application_Setup.md

* Update 08_Multi_Application_Setup.md
  • Loading branch information
BlackbitDevs authored Oct 11, 2024
1 parent 2c42dd3 commit 56f8f15
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Multi-application setup

## Sessions

When running multiple applications on the same domain, there can be session cookie collisions which prevent you to log in to both systems at the same time.

Imagine you run a web shop app on http://example.org and Pimcore on http://pim.example.org. Then you will have 2 cookies with name `PHPSESSID` (if `session.name` in php.ini is the same for both):
| Name| Value | Domain | Path |
|---|---|---|---|
| PHPSESSID | 5a9b08750387d9e11c738a2947d93e38 | .example.org | / |
| PHPSESSID | irqnjh5p96gp2i8iu743ulm32p | pim.example.org | / |

First one is from the web shop, second one from Pimcore.
When trying to log in at http://example.org/admin you will get a 403 Forbidden error.
(The reason why the web shop sets the cookie for `.example.org` instead of `example.org` probably is to also support subdomains.)

You can prevent this problem with the following config in your `config.yaml`. This way the session cookies do not conflict anymore and you will be able to log in to both applications at the same time.
```yaml
framework:
session:
name: "PIMCORE_SESSION_ID"
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@

## Advanced Topics
- [Cluster Setup](07_Cluster_Setup.md)
- [Multi-application setup](08_Multi_Application_Setup.md)
- [Performance Guide](09_Performance_Guide.md)

0 comments on commit 56f8f15

Please sign in to comment.