Reputation: 1757
i have problem with php cake session and subdomains. I have setted all successfully right. When i try to go from
subdomain1.domain.com
to
subdomain2.domain.com
all works nicely when i put these browser url... problem comes when i try to make this with <a href=""> tag
, on redirected subdomain i will recieve new session id.
I cant explain to my self how can be this possible, pure php script works fine but in php cake is this bug! thanks for any suggestion...
Upvotes: 1
Views: 469
Reputation: 1757
ok, i debug whole php cake session component and lib, i figure out 2 sollutions
easier - set in core.php security level to low
Configure::write('Security.level', 'low');
advanced - make new config file for sessions, like Ivo said, its in tutorial http://book.cakephp.org/view/1310/Sessions ,most important thing is set
ini_restore('session.referer_check'); because by default php cake check referrer, and if it goes not form same domain it will cause generating new SESSIONID
Upvotes: 1
Reputation: 5420
Try using this instead:
http://book.cakephp.org/view/1310/Sessions
Follow the directions to create custom configuration for cake's session saving.
Upvotes: 0
Reputation: 11295
I don't think it's related with cake. By default, PHP will give you a session for the domain.
All thoses examples are 4 distincts domains, with their own session.
If you want to share the session between many (sub)domain, you can try to set the session.cookie_domain variable, like this;
ini_set("session.cookie_domain","domain.com") ;
Upvotes: 0