Re: session vars and frames
| From: | Justin French | Date: | Fri, 28 Jun 2002 16:02:35 +0000 |
| Subject: | Re: session vars and frames | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104354@lists.php.net to get a copy of this message | ||
Well, that's what a session is... somehow you track the user, hence you're
maintaining session. How are you maintaining session? It sounds like
you're doing it using PHP's standard session functions, which default to
cookies... it's worth noting that this won't work for browsers without
cookies.
Anyhoo, have you read all the page on sessions in the manual?
EVERY page basically has to start with session_start() in order to maintain
the session, and you have to assign/retrieve variables (like
$_SESSION['user']) from it.
If you ARE using session_start() on each page, my second guess is that
you're expecting $session_user to be in the global space, whereas it might
actually be $_SESSION['session_user'];
I guess with frames, this has to be maintained on each page within the
frame, and if the session is lost / invalid / cancelled in one frame, it
should be reflected in the other frames, which is tricky stuff at first
glance.
I think I'd be steering clear of sessions when using frames, unless I had a
very clear understanding of what's going on... it sounds like you're a bit
of a newbie in the session area.
I'd try and get a decent member/pass/login/session system working without
frames first.
Justin French
on 28/06/02 7:25 PM, W. Enserink (enserink@pdd.nl) wrote:
> hmmm, i'm not passing anything around, at least not on purpose.
>
>
> Wilbert
>
>
> ----- Original Message -----
> From: "Justin French" <justin@indent.com.au>
> To: "php" <php-general@lists.php.net>
> Sent: Friday, June 28, 2002 11:14 AM
> Subject: Re: [PHP] session vars and frames
>
>
>> Are you passing the session ID around in the URL, or in cookies?
>>
>> Justin French
>>
>>
>> on 28/06/02 6:28 PM, Wilbert Enserink (wilbert@pdd.nl) wrote:
>>
>>> hi all,
>>>
>>>
>>> I'm registering if people are logged in. The login page is situated in
> the
>>> mainFrame.
>>> Now in my leftFrame I want to put the status (i.e. "you are logged in as
>>> .....")
>>>
>>> When people are succesfully logged in I register their name as
>>> session_register('session_loginname');
>>> I then refresh the leftFrame.
>>> In the page to be displayed in the leftFrame I put:
>>>
>>> <?php if (!isset($session_loginname))
>>> {
>>> echo "you are not a member";
>>> }
>>> else
>>> {
>>> echo "login: $session_loginname";
>>> }
>>> ?>
>>>
>>>
>>> However, my leftFrame page keeps on displaying "you are not a member" So
> I was
>>> wondering: is there something with sessionvariables and frames which I
> don't
>>> know??
>>> If anybody has any ideas I would be happy to hear them.
>>>
>>>
>>> regards
>>>
>>> Wilbert
>>>
>>>
>>> -------------------------
>>> Pas de Deux
>>> Van Mierisstraat 25
>>> 2526 NM Den Haag
>>> tel 070 4450855
>>> fax 070 4450852
>>> http://www.pdd.nl
>>> info@pdd.nl
>>> -------------------------
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> info@pdd.nl
> -------------------------