Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
I've got a couple of sites running on different subdomains, but the same domain.
something like this:
When I start a session in one of those, that session is only valid in that session. How do I make the session valid for the entire "mydomain.com" domain?? so that variables in the session are available in all subdomains?
nobody got any idea??
problem should be solved when the cookie, wich the session automaticly sets, appears in every subdomain.
so if I start a session in sub1.domain.com and then go to sub2.domain.com the cookie set by the first session appears there.
Just found it out myself:
- Code: Select all
$cookie_settings = session_get_cookie_params();
This will make the session work throughout any subdomain you want.
lifetime stays the same this way.
Great monologe if I may say so myself ;) :mrgreen:
Return to PHP coding => General
Who is online
Users browsing this forum: Google [Bot], Google Feedfetcher and 1 guest