Re: Sessions and iframes (or frames)?
| From: | Justin French | Date: | Sun, 30 Mar 2003 22:40:07 +0000 |
| Subject: | Re: Sessions and iframes (or frames)? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141661@lists.php.net to get a copy of this message | ||
My advice is to first get REALLY comfortable with sessions in a non-framed
environment... get a grip on logging in, logging out, showing different code
for logged in members, restricting a user from doing something more than
once, etc etc.
THEN try to get it happening in a framed environment.
As discussed by John, you will have to force a refresh for any frame to be
"aware" of a recently logged in user, and you will have to do a lot of
checking when receiving a form or request in each of these frames, to ensure
there is a user logged in, etc.
As per ANY session stuff between pages, you need to propogate the session id
either through the URL to each frame (or hope that trans-sid takes care of
it), or rely on the user having cookies enabled.
To point out the really obvious, <? session_start(); ?> needs to be called
on the top of the script for EACH FRAME.
Justin
on 31/03/03 5:41 AM, Tiago Simões (kaos@netcabo.pt) wrote:
> Hello.
>
>
> I built this site using using different iframes: one for a login, other for
> a forum, another for a voting poll, etc...
>
> I was wondering what is the best way to ensure that you could only post a
> topic in the forum, or vote if you had already logged in.
>
> I'm somewhat familiar with the $_session global variable, but only if the
> code happens in the same page. How can you check, from another frame, that
> user is logged?
>
> Thanks in advance...
> Tiago Simões
>
>