php-general Digest 7 Dec 2012 20:17:52 -0000 Issue 8058
Topics (messages 319809 through 319818):
Session ?
319809 by: Jim Giner
319810 by: Daniel Brown
319811 by: Jim Giner
319812 by: Daniel Brown
319813 by: Jim Giner
319814 by: Sebastian Krebs
319815 by: Daniel Brown
319816 by: Jim Giner
319817 by: Jim Giner
319818 by: Daniel Brown
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Something new for me - working with scripts on two of my sub-domains.
I want to call script 2 in my B domain from script 1 in my A domain.
It appears that the session vars established in script 1 do not show up
in script 2. Is that because the domain name is different? Is this
where one must grab the session id and use it in another script in order
to retain the original session and its vars? If this is so, can someone
elaborate on the capture of the session id process?
--- End Message ---
--- Begin Message ---
On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> Something new for me - working with scripts on two of my sub-domains.
>
> I want to call script 2 in my B domain from script 1 in my A domain.
>
> It appears that the session vars established in script 1 do not show up in
> script 2. Is that because the domain name is different? Is this where one
> must grab the session id and use it in another script in order to retain the
> original session and its vars? If this is so, can someone elaborate on the
> capture of the session id process?
Are both domains on the same physical (or virtual) server?
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 12/7/2012 2:36 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
Something new for me - working with scripts on two of my sub-domains.
I want to call script 2 in my B domain from script 1 in my A domain.
It appears that the session vars established in script 1 do not show up in
script 2. Is that because the domain name is different? Is this where one
must grab the session id and use it in another script in order to retain the
original session and its vars? If this is so, can someone elaborate on the
capture of the session id process?
Are both domains on the same physical (or virtual) server?
Yes - they are sub-domains of my main one.
--- End Message ---
--- Begin Message ---
On Fri, Dec 7, 2012 at 2:38 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> On 12/7/2012 2:36 PM, Daniel Brown wrote:
>>
>> On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com>
>> wrote:
>>>
>>> Something new for me - working with scripts on two of my sub-domains.
>>>
>>> I want to call script 2 in my B domain from script 1 in my A domain.
>>>
>>> It appears that the session vars established in script 1 do not show up
>>> in
>>> script 2. Is that because the domain name is different? Is this where
>>> one
>>> must grab the session id and use it in another script in order to retain
>>> the
>>> original session and its vars? If this is so, can someone elaborate on
>>> the
>>> capture of the session id process?
>>
>>
>> Are both domains on the same physical (or virtual) server?
>>
> Yes - they are sub-domains of my main one.
<?php ini_set('session.cookie_domain','.example.com'); ?>
The preceding dot before the SLD allow the session cookie to be
accessible on *.example.com.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 12/7/2012 2:41 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:38 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
On 12/7/2012 2:36 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com>
wrote:
Something new for me - working with scripts on two of my sub-domains.
I want to call script 2 in my B domain from script 1 in my A domain.
It appears that the session vars established in script 1 do not show up
in
script 2. Is that because the domain name is different? Is this where
one
must grab the session id and use it in another script in order to retain
the
original session and its vars? If this is so, can someone elaborate on
the
capture of the session id process?
Are both domains on the same physical (or virtual) server?
Yes - they are sub-domains of my main one.
<?php ini_set('session.cookie_domain','.example.com'); ?>
The preceding dot before the SLD allow the session cookie to be
accessible on *.example.com.
What if my sub-domain names are not in the form of 'a.domain.com' and
'b.domain.com'.
--- End Message ---
--- Begin Message ---
2012/12/7 Jim Giner <jim.gi...@albanyhandball.com>
> On 12/7/2012 2:41 PM, Daniel Brown wrote:
>
>> On Fri, Dec 7, 2012 at 2:38 PM, Jim Giner <jim.gi...@albanyhandball.com>
>> wrote:
>>
>>> On 12/7/2012 2:36 PM, Daniel Brown wrote:
>>>
>>>>
>>>> On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com
>>>> >
>>>> wrote:
>>>>
>>>>>
>>>>> Something new for me - working with scripts on two of my sub-domains.
>>>>>
>>>>> I want to call script 2 in my B domain from script 1 in my A domain.
>>>>>
>>>>> It appears that the session vars established in script 1 do not show up
>>>>> in
>>>>> script 2. Is that because the domain name is different? Is this where
>>>>> one
>>>>> must grab the session id and use it in another script in order to
>>>>> retain
>>>>> the
>>>>> original session and its vars? If this is so, can someone elaborate on
>>>>> the
>>>>> capture of the session id process?
>>>>>
>>>>
>>>>
>>>> Are both domains on the same physical (or virtual) server?
>>>>
>>>> Yes - they are sub-domains of my main one.
>>>
>>
>> <?php ini_set('session.cookie_**domain','.example.com'); ?>
>>
>> The preceding dot before the SLD allow the session cookie to be
>> accessible on *.example.com.
>>
>> What if my sub-domain names are not in the form of 'a.domain.com' and '
> b.domain.com'.
What do you mean? Subdomains are always in the form "*.example.com"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
github.com/KingCrunch
--- End Message ---
--- Begin Message ---
On Fri, Dec 7, 2012 at 2:54 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
>
> What if my sub-domain names are not in the form of 'a.domain.com' and
> 'b.domain.com'.
A subdomain is a subdomain. Unless you've discovered a new
magical form of subdomain that is not, you should be fine. And if you
have, in fact, made that discovery, you're probably the reason the
Mayans predicted a very short winter this year. Thanks for screwing
us, Jim.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 12/7/2012 2:58 PM, Sebastian Krebs wrote:
2012/12/7 Jim Giner <jim.gi...@albanyhandball.com>
On 12/7/2012 2:41 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:38 PM, Jim Giner <jim.gi...@albanyhandball.com>
wrote:
On 12/7/2012 2:36 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner <jim.gi...@albanyhandball.com
wrote:
Something new for me - working with scripts on two of my sub-domains.
I want to call script 2 in my B domain from script 1 in my A domain.
It appears that the session vars established in script 1 do not show up
in
script 2. Is that because the domain name is different? Is this where
one
must grab the session id and use it in another script in order to
retain
the
original session and its vars? If this is so, can someone elaborate on
the
capture of the session id process?
Are both domains on the same physical (or virtual) server?
Yes - they are sub-domains of my main one.
<?php ini_set('session.cookie_**domain','.example.com'); ?>
The preceding dot before the SLD allow the session cookie to be
accessible on *.example.com.
What if my sub-domain names are not in the form of 'a.domain.com' and '
b.domain.com'.
What do you mean? Subdomains are always in the form "*.example.com"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
My bad - I was referencing the "add-on domain" name which is not. Yes -
there are subs in the correct format which I forgot about.
--- End Message ---
--- Begin Message ---
On 12/7/2012 2:59 PM, Daniel Brown wrote:
On Fri, Dec 7, 2012 at 2:54 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
What if my sub-domain names are not in the form of 'a.domain.com' and
'b.domain.com'.
A subdomain is a subdomain. Unless you've discovered a new
magical form of subdomain that is not, you should be fine. And if you
have, in fact, made that discovery, you're probably the reason the
Mayans predicted a very short winter this year. Thanks for screwing
us, Jim.
OK - now that I've messed us all up, help me to understand your proposed
solution. I added the ini-set line to my first script. Then I called
my second one and still had the same problem with a missing session var.
Is there a corresponding line I need in the 'called' script? And does
it matter where this line is place within the script?
--- End Message ---
--- Begin Message ---
On Fri, Dec 7, 2012 at 3:04 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
>
> OK - now that I've messed us all up, help me to understand your proposed
> solution. I added the ini-set line to my first script. Then I called my
> second one and still had the same problem with a missing session var. Is
> there a corresponding line I need in the 'called' script? And does it
> matter where this line is place within the script?
From your response to Sebastian, I'm not sure it will work. They
need to be subdomains of the same domain; different domains won't
work. However, proceeding with the presumption that the subdomains
are under the same SLD (e.g. - apple.example.com and
orange.example.com), this should work:
<?php
// apple.example.com
ini_set('session.cookie_domain','.example.com');
session_start();
$_SESSION['foo'] = 'bar';
session_write_close();
?>
Then....
<?php
// orange.example.com
ini_set('session.cookie_domain','.example.com');
session_start();
echo isset($_SESSION['foo']) ? $_SESSION['foo'] : 'Session failed to transfer.';
?>
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---