php - sharing cookie and session between subdomain -
i have m.xxxx.com , www.xxxx.com subdomains project in www.xxx.com , when need send ajax request login , on return value when call again session , cookie removed
i testing application www.xxxx.com/mobile
and request worked probebly should
and sitting access-control-allow-origin:*;
for cross origin problem session not sharing between 2 subdomains
try this:
the way can think of save session data cookie, open cookie when other domain accessed. can read how here:
http://www.depiction.net/tutorials/php/cookies-session-variables.php
why want this?
or
also can try
you looking function: session_set_cookie_params()
. have 2 domains:
site1.example.com site2.example.com
in order share session data across both domains, call following function before session_start()
:
session_set_cookie_params(0, '/', '.example.com');
Comments
Post a Comment