I have a main PHP platform with a 'Zen' directory, inside which I have a 'discussions' folder where Flarum is installed. However, instead of using Flarum's login and signup, I want to use the same login system as Zen. I'm storing the sessions as IDs. How can I achieve this? The flow should be such that when I log in to the main directory, I should automatically be logged into the discussions as well. Similarly, the logout should work in sync, ensuring the authentication is synchronized.