a nadjoh upravo i ovo, da funkcija setcookie moze da set-uje vrednost i za poddomene;
http://php.net/manual/en/function.setcookie.php
Citat:
5th parameter: domain
The domain that the cookie is available to. To make the cookie available on all subdomains of example.com (including example.com itself) then you'd set it to '.example.com'. Although some browsers will accept cookies without the initial ., » RFC 2109 requires it to be included. Setting the domain to 'www.example.com' or '.www.example.com' will make the cookie only available in the www subdomain.
|
dakle, ako se stavi .domen.com - cookie ce vaziti i za poddomene [ovo vidis ni ja nisam znao].
to ti isto vazi i za sesiju.
a resenje koje sam izneo gore se koristi samo ako hoces sesiju da prebacis na skroz razlicite domene.