NEWBIE: session_start() data lost between pages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a login page and a target page that when the user is logged in is
redirected to.

The structure of the site is:

domain (
        Actual hosted site (

When a user goes to the "teamspage.php" on the hosted site, the first part
of the server side code does this:

Re: NEWBIE: session_start() data lost between pages

SPG wrote:
Quoted text here. Click to load it

That's not much, isn't it? ;-)

Anyway, in a default environment, session id's are stored in cookies.
Cookies are domain dependent, which means that a cookie set for domain A
cannot be read from domain B. Subdomains are okay, so a cookie set on domain
B can also be read from subdomain A.B when the session.cookie_domain
directive in the php.ini file is set to ".B".

When you really need to read the session id from domain A on domain B, you
should disable the session.use_cookies directive in the php.ini file. This
way, the id can always be retrieved from the $_GET array, identified by the
name defined by the directive.

BTW, the following page is a must read:


Site Timeline