Serving content through another site via CNAME DNS alias

Hello and thanks for reading. Big fan of Yii for many years.

I’m trying to serve content from my content.primary.com to display.secondary.com and I’m able to do this via CNAME entry pointing display.secondary to alias content.primary. On the controller side, I can detect where it’s opened from and then redirect to the same host via

if(Yii::$app->request->hostInfo == 'display.secondary'){ do something }

I setup a Wildcard Multi-domain SSL that is valid for both domains, so there’s no SSL warning.

Seems to work pretty well for viewing content, but with one or more issues that present themselves. One is that when someone logs into the site via a form on secondary. (but POSTing to content.primary), I’m logged into content.primary, but when displayed from secondary, I’m not logged in. My guess is that the session created is only valid for primary and not secondary. Is there any work-around to this? Maybe create a separate credentials session that works with secondary?

Thanks for any advice!