Re: Session ?
| From: | Jim Giner | Date: | Sat, 08 Dec 2012 15:47:02 +0000 |
| Subject: | Re: Session ? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319823@lists.php.net to get a copy of this message | ||
On 12/7/2012 3:20 PM, Sebastian Krebs wrote:
2012/12/7 Daniel Brown <danbrown@php.net>On Fri, Dec 7, 2012 at 3:04 PM, Jim Giner <jim.giner@albanyhandball.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.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. Theyneed 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpWhat does doing session.auto_start to 0 do to me?