php-general Digest 8 Dec 2012 15:47:10 -0000 Issue 8059

Topics (messages 319819 through 319823):

Re: Session ?
        319819 by: Sebastian Krebs
        319820 by: Daniel Brown
        319821 by: Jim Giner
        319822 by: tamouse mailing lists
        319823 by: Jim Giner

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 ---
2012/12/7 Daniel Brown <danbr...@php.net>

> 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.';
> ?>
>

Would be better to put 'session.cookie_domain' into the php.ini. In both
cases: Clear cookies (at least for your site) completely and set
session.auto_start to 0.

>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> 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 3:20 PM, Sebastian Krebs <krebs....@gmail.com> wrote:
>
> Would be better to put 'session.cookie_domain' into the php.ini. In both
> cases: Clear cookies (at least for your site) completely and set
> session.auto_start to 0.

    If it's configured on the server for overrides, sure, a local one.
 Otherwise, the system php.ini will break all other domains on the
server.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
So i need the ini set in both scripts. Thx. Ill try that later

jg

--- End Message ---
--- Begin Message ---
On Fri, Dec 7, 2012 at 2:04 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> 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?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

also remember to clear cookies (on browser), and session caches (on server)

--- End Message ---
--- Begin Message ---
On 12/7/2012 3:20 PM, Sebastian Krebs wrote:
2012/12/7 Daniel Brown <danbr...@php.net>

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.';
?>


Would be better to put 'session.cookie_domain' into the php.ini. In both
cases: Clear cookies (at least for your site) completely and set
session.auto_start to 0.


--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




What does doing session.auto_start to 0 do to me?

--- End Message ---

Reply via email to