afterlogic / webmail-lite-8

Open-source webmail script for existing IMAP server
https://afterlogic.org/webmail-lite-8
GNU Affero General Public License v3.0
335 stars 71 forks source link

"Cookies are disabled in the browser." with nginx subdomain setup #57

Closed Xaymar closed 4 years ago

Xaymar commented 4 years ago

My nginx is configured to automatically "discover" subdomains if they are directories contained in the top level directory for the specified domain. Subdomains are handled so that they actually forward the request to the actual domain, which means that subdomain.example.com/ is actually example.com/subdomain.

This setup works for the majority of web-facing software which can be installed, as that software usually does not enforce auto-discovery of the domain name. However I do not see such an option for AfterLogic WebMail, which results in "Cookies are disabled in the browser." and seemingly no easy way to fix it. Changing the nginx configuration is a no go as other installed software relies on this setup.

Is there any way to specify on which URL WebMail should be creating cookies? I found a similar issue here but it is using CloudFlare which is not my issue (not using CloudFlare).

afterlogic-support commented 4 years ago

According to the devs, the product doesn't currently support assigning custom domain and/or path cookies are associated with. However, there's one core location in the code where cookie path is being set, so adjusting the code and the value returned should do the trick for you. The code is found in system/Api.php file, getCookiePath is the function you're looking for.