Re: session array not available in popup? [message #176989 is a reply to message #176988] |
Mon, 13 February 2012 20:53 |
cerr
Messages: 33 Registered: September 2010
Karma:
|
Member |
|
|
On Feb 13, 12:12 pm, "J.O. Aho" <u...@example.net> wrote:
> cerr wrote:
>> On Feb 13, 11:30 am, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>>> On 2/13/2012 2:21 PM, cerr wrote:
>>>> <?php
>>>> session_start();
>>>> var_dump($_SESSION);
>>>> ?>
>>>> at the top of my popup script just prints
>>>> array(0) { }
>>>> and this is what the session dumps on the page from where I open the
>>>> popup:
>>>> string(2) "10"
>
> If you have used
>
> $_SESSION = "10";
I didn't.
>
> then you haven't used the session as it's intended to work, try instead:
>
> $_SESSION['integer'] = 10;
I do use it like an array: $_SESSION['userid']
>
>>> Is the popup accessing the same domain as the main window?
>
>> Yes, they're both on the same domain, different directories tho but
>> that shouldn't matter, would it?
>
> Depends on your session.cookie_path
>
> See:http://www.php.net/manual/en/function.session-set-cookie-params.phphttp ://www.php.net/manual/en/session.configuration.php#ini.session.co...
I'm currently not using cookies, I'm passing the sessionid as a get
variable to the script and set it like:
session_id($_GET['sessionid']);
session_start();
echo $_GET['sessionid']."<br/>";
echo session_id();
>
> OT: Please remove things that you don't reply at, like signatures.
Yep, sorry
|
|
|