Re: Session problems / where to register
| From: | Richard Lynch | Date: | Sat, 24 Aug 2002 23:20:50 +0000 |
| Subject: | Re: Session problems / where to register | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113999@lists.php.net to get a copy of this message | ||
>I had a similar question about session scope before, and I learned that if I
>want a session variable to be available across my subdomains
>(www.domain.com, my.domain.com, mail.domain.com), I need to register it at
>domain.com. So I understand that..
>
>The problem I have now is this: I have users who are going to enter the
>site at my.domain.com. When they hit the index page there, a check is
>performed against the cookie, and if they are authenticated, it loads their
>personal index page. But if I want to register session variables here, they
>are only going to be available to my.domain.com pages, not www.domain.com or
>mail.domain.com. Short of using a Header call to redirect them to a page on
>domain.com which just registers the session variables, does anyone have any
You *should* be able to set the Cookies required for domain.com that works
across all the domains, as I understand it... Never tried it, though...
Another option is to pass the SID through the URL with --enable-trans-id (or
similar in php.ini) or if you only have a limited number of "transfer
points" from sub-domain to sub-domain doing it "by hand" in those URLs.
>tricks or advice in tackling this problem? The redirection to set session
>variables, then redirecting back, is kind of ugly.
I think this is going to not work on some browsers anyway... Any time you
mix redirect and Cookies, a number of browsers/servers are going to mess
up...
Kind of like telling a kid to run to the store (redirect), and they take off
for the store before you get a chance to hand them the shopping list
(cookie). :-)
--
Like Music? http://l-i-e.com/artists.htm