I'm using a domain like www.example.com and a sub-domain like sub.example.com.
I'm trying to call the Login
function of sub.example.com.
In the end I cant set the session of sub.example.com for future functions to be called.
I'm using CodeIgniter in my sub-domain and my root domain just has an HTML page with native JavaScript. I wanted to use sub.example.com as my endpoint for all my sub-websites.
I tried changing the config of my subdomain(CI) to
$config['cookie_prefix'] = "";
$config['cookie_domain'] = ".example.com";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
and also the index.php file of my www.example.com to:
session_set_cookie_params(0, '/', '.example.com');
session_start();