Page 1 of 1

Passing SESSION Vars

Posted: Sat Aug 28, 2004 8:48 am
by AliasBDI
Is it possible to pass SESSSION VARs over HTML frames? Before you answer look at my example:

I have a sign in form which redirects to a particular PHP file that contains frames. The redirect is according the USERS domain column. In other words, they login with user, domain, password.

The action page checks the database for the user. If the user exists and the user, domain, password are correct, it redirects them to an 'index.php' page in a directory which has the same name as their domain as recorded in the database.

The 'index.php' page is a basic framed HTML page (with 2 frames). One frame calls the local 'nav.php' page into it. The other calls another page irrelavent to my question.

The 'nav.php' page requires a query based on the user's ID column. How do I get the user's ID variable passed to that page?

(1) I figured that the SESSION could contain it. But it didn't work. Plus, I believe that SESSION variables are kept in accordance with the initial browser window and not any included frames. :( It did not work regardless.

(2) I figured I would have to pass the variable in the initial page where the user is checked against the database and then redirected. I wasn't sure how to created that redirect so that it targets both the parent and the parent's "nav" frame.

Is there another way of doing this? Or do I need to roll with option #2? If option #2 is best, do you know how to pull it off?

Posted: Sat Aug 28, 2004 9:10 am
by AliasBDI
Ahhh. I think it does work with the SESSION vars being passed. It looks like the SESSION is good for all of the pages pulled into the frame! Unless I did something wrong, I think that is working! I think I answered my own question!

Posted: Mon Aug 30, 2004 12:26 pm
by AliasBDI
Moderator.... Please mark as SOLVED. It IS possible to send SESSION variables over window frames without passing them through URLs.