Page 1 of 1

Session Trouble (session gone when navigate elsewhere)

Posted: Thu Sep 21, 2006 2:42 am
by nyfael
Hi all,

I'm having a slight session problem. My sessions will hold as long as I am in the same domain or subdomain, but as soon as I navigate out of it (even from a subdomain to the domain), it disappears.

I want my sessions to hold for 30 minutes, would I make this a cookie instead of a session? But as I knew it, sessions are supposed to hold until you close the browser. Am I incorrect in this assumption?

-Kerry

Posted: Thu Sep 21, 2006 3:11 am
by aaronhall
PHP Sessions (normally) use cookies to keep track of users between page loads and match them up with their session data (which is stored on the server side). http://us2.php.net/manual/en/function.s ... params.php should help solve your problem.

Posted: Thu Sep 21, 2006 3:12 am
by onion2k
Sessions are bound to a particular domain. They won't work across different domains unless you set the cookie up to work like that. Try reading the manual for session_set_cookie_params().

EDIT: Bah.. too slow! :)

Posted: Fri Sep 22, 2006 12:42 am
by nyfael
haha, thanks :)