My user is logged in at site_url.com
on a CMS, however I am now developing a mobile version of the site, outside the CMS on a subdomain m.site_url.com
and would like the session to be synchronized with the CMS.
I have included a file with all the CMS' functions like this:
<?php include('/home/flyeurov/public_html/core/codon.config.php');
The subdomain m.site_url.com
is located at /public_html/mobile
directory. Inside /mobile
is index.php
and a trigger to display a dashboard or a login form, depending on user's state (logged in or not).
It is working, and I am able to login and see the dashboard, however only when I access direct path for example site_url.com/mobile/index.php
. If I am logged in, and I access this path, it will take me to crew_center.php
- the dashboard.
This does not happen when I access the subdomain at m.site_url.com
. Even when I am logged in, I get shown login.php
page.
Here is index.php
:
<?php include('/home/flyeurov/public_html/core/codon.config.php');
session_set_cookie_params(0, '/', '.site_url.com');
if(Auth::LoggedIn())
{
header("Location: crew_center.php");
}
else
{
header("Location: login.php");
}
?>
I can therefore imagine that this is down to a session issue, but how can I share the CMS' session with the m
subdomain?