Page 1 of 1

Session Array Different On Different Pages With Same SESSID

Posted: Thu Sep 30, 2004 1:35 pm
by Crashin
Sorry to be thick, but could someone explain to me why this is? I've got two different authentication systems on my site: one for a shopping cart/ordering system, and one for a support/product system. I register session variables for each, to keep track of the user's login status, shopping cart contents, etc.

My problem is I'd like to access session variables from one area in another, however the session variables from one aren't available in another. I've checked the $_SESSION array on the respective pages and it only contains the variables for the area in which I am at that time. I've checked the session ids to make sure they are the same in both areas (via session_id()) and they are the same session.

Lastly, I can go freely back and forth between the shopping cart and the other area and their respective session variables are retained and available.

I'm baffled.

Posted: Thu Sep 30, 2004 2:40 pm
by feyd
are these under different sub-domains? depending on your session settings, and if the sessions are started on differing subdomains, the domain setting will vary, and thus create 2 differing cookies.

Posted: Fri Oct 01, 2004 11:03 am
by Crashin
Thanks for they reply, Feyd. No, they aren't under different sub-domains. Both directories, and both sessions, are under the same main domain.

Posted: Fri Oct 01, 2004 12:31 pm
by feyd
then there's no need (generally) to set the domain argument. You still need to set the path argument though.