I have one domain and sub domain as bellow,
domain-name.local
sub.domain-name.local
I have a login system in domain-name.local
and I need to use same sessions to validate while accessing sub.domain-name.local
.
As mention in the question I have tried following things in sub domain without success,
Set php.ini session.cookie_domain
as .domain-name.local
Results :
firefox- worked ie- not loading while accessing the session from sub domain chrome - not giving any session details
set from php code as bellow
ini_set('session.cookie_domain', '.domain-name.local');
session_start();
var_dump($_SESSION);
Results :
firefox - not giving any session details , ie- not loading while accessing the session from sub domain, chrome - not giving any session details
another php code as suggest in that question,
session_set_cookie_params(0, '/', '.domain-name.local');
session_start();
var_dump($_SESSION);
Results : same as second
Any help would be appreciate since i'm stuck here for long time.
EDIT :
When I checked the cookies, I can see two PHPSESSID
was created. I think that is the issue. I need to use the same PHPSESSID
from the main.
EDIT 2
When I set the session.cookie_domain
to .domain-name.local
from the php.ini
or .htaccess
, everything is working fine except in the IE
(ie 10/win 8). In IE
sometimes session can access sometime web page totally not accessible(keep loading but no result for minutes).
Does anyone was having same experience on the same issue.