Possible Duplicate:
PHP SESSION lost on SUBDOMAIN
I can't use a session on a subdomain @ panel.cyberbat.co.uk
But cyberbat.co.uk sessions work fine, the session is created on the main domain but can't be used on the subdomain, could anyone help me?
FIXED: I used a Coookie i开发者_StackOverflownstead of a session.
You could use ini_set('session.cookie_domain', '.cyberbat.co.uk');
(note the dot in front of the value), that way the session cookie will work on all subdomains.
Or, if you have your own cookies, you can also specify the domain in setcookie
:
setcookie('mycookie', $a_value, time() + 3600, '/', '.cyberbat.co.uk');
精彩评论