I have a sub-domain ‘admin.mydomain.com’ and I want to Redirect using Header() to ‘mydomain.com’ but use Session variables to transfer information.
The Redirect works fine but only the first one of three Session variables declared in the subdomain index.php are set when the main domain index.php loads.
Has anybody experienced this before?
Is there a better way to do this? Using query string works fine but values will be on display.
sessions are normally stored in cookies. In order for the cookie holding the session to be available to both the subdomain and the main domain it needs to be set on the main domain. So what you need to do is to override the domain setting for the cookie to reference the main domain rather than the subdomain when you set it on the subdomain.