Hello,
I am working on a site which has two domain part e.g.
abc.com and xyz.abc.com ( sub-domain of abc.com )
when one get logged in at xyz.abc.com, It store username in the session so that if any user after logged in at sub-domain, manually enter abc.com in the address bar, he should be redirected to xyz.abc.com. But session is not working between these domain and sub-domain.
Please advise.
Thanks a million =)
session is not working between domain and sub-domain
Moderator: General Moderators
Set the value for session.cookie_domain. Before initializing session (session_start()) put this line
ini_set ( 'session.cookie_domain', '.abc.com' );
for more info visit http://www.php.net/manual/en/ref.sessio ... kie-domain
ini_set ( 'session.cookie_domain', '.abc.com' );
for more info visit http://www.php.net/manual/en/ref.sessio ... kie-domain
thanks for your reply. I tried this but it does not work for me. I have searched here and there and come to know this works if we create session in TLD and use in SLD but I want to create login session in sub-domain e.g. abc.xyz.com and then i want to check that session in TLD e.g. xyz.com
Please advise
Please advise