I'm working in a PHP project that uses subdomains, sessions and Ajax. But unfortunately I can't make it work! I'll try explain:
Let's assume that I'm at this domain: app.mysite.com/index.php
At this domain, I have a form that performs an Ajax request to mysite.com/functions/execute.php (without any subdomain)
In the first line of execute.php, I have a require_once that include a helper.php file. In this file I have put:
ini_set('session.cookie_domain', '.mysite.com');
session_set_cookie_params(0, '/', '.mysite.com');
session_start();
All PHP files listed also include the helper.php.
If I for example run:
echo $_SESSION["myValue"];
At app.mysite.com/index.php or any other subdomain, like auth.mysite.com, I'll get the value: "test". But if I run the same code at execute.php, and return the value through Ajax I'll get undefined index!
What am I doing wrong?