Links open i browser instead of app

Interesting, so the cookies are being set by the landing page and you can see them, but they’re being ignored?
Just one wild guess here, but can you confirm that your SiteUrl configuration setting is set to the URL your web- and desktop apps are connecting to, including the protocol and ports? So if your server is reachable via https://yourdomain.com:8443/mattermost, f.ex., your SiteUrl configuration value also needs to be set to this value.
Is there any reverse proxy in front of the Mattermost server that might tinker with the cookies being sent back and forth between the client and the server?