472,983 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 software developers and data experts.

Session variables through frames - need help.

Hi there,

I have implemented a login sequence using session variables for a PHP/MySQL
DB which I took over development. I read some books and this NG and it
seemed straight forward. However the website I have taken over uses two
frames. The left hand side is always a navigation frame with the righthand
side of the screen always being the target.

I developed a main web page where login takes place and if successful a
session variable is set which all other pages look for before processing (if
it's not there they redirect to login page).

All seems to work OK from my PC until I use another frame as a URL
redirection to the PHP website. Therefore I want to use a nicer URL to where
the actual PHP website is hosted and so set another website to use frame
redirection to my PHP website DB.

When I do this the login session variables no longer seem to work and I can
no longer stay logged in. I assume this is something to do with where the
actual session variables are being set but do not know enough to be sure.
What is the problem and is there an easy way around it?

Any help on this matter greatly appreciated.

Kind regards

Dave
Jul 17 '05 #1
1 2208
On Mon, 02 May 2005 22:58:21 +0100, Dave Smithz wrote:
Hi there,

I have implemented a login sequence using session variables for a PHP/MySQL
DB which I took over development. I read some books and this NG and it
seemed straight forward. However the website I have taken over uses two
frames. The left hand side is always a navigation frame with the righthand
side of the screen always being the target.

I developed a main web page where login takes place and if successful a
session variable is set which all other pages look for before processing (if
it's not there they redirect to login page).

All seems to work OK from my PC until I use another frame as a URL
redirection to the PHP website. Therefore I want to use a nicer URL to where
the actual PHP website is hosted and so set another website to use frame
redirection to my PHP website DB.

When I do this the login session variables no longer seem to work and I can
no longer stay logged in. I assume this is something to do with where the
actual session variables are being set but do not know enough to be sure.
What is the problem and is there an easy way around it?

Any help on this matter greatly appreciated.

Kind regards

Dave


I've played around with frames only a little, but am also using some
iframes and I think the situation is the same.

In a no-frames situation, you have your session_start() call somewhere on
each page's script, and since your browser sends the same session ID, your
session is continued, and your session variables are remembered, from page
request to page request.

In a frames situation, you can have the same thing happen. Each frame
calls its separate source URL. In this case, each of these source URL's
have to be php scripts, and they all have to call session_start()
somewhere at the top of the script.

Since your browser works in the same browser window when loading up
various frames, the browser sends the same session key, so if you do the
above, your session variables are accessible from all frames.

You can also have one frame read in a form on submit, collect the posted
values from $_POST and put them into $_SESSION, so that the posted form
values will be available to other frames.

Hope that helps.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
4
by: A Web Master | last post by:
I am designing a site for a client where I have a frameset and 3 frames (all in ASP). I am creating session variables in the frameset that need to be accessed in the frames. It seams that in...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
6
by: Rolf Rosenquist | last post by:
From a html page with frames, I have a link to an asp application. When I let it go to a new browser, all the session variables work as intended. But when I link it into the main frame as target,...
2
by: Bonj | last post by:
H I've got the following problem - I need to have an aspx page with two frames, although the question isn't necessarily about the workings of the frames, more session variables... the frames consist...
2
by: KathyB | last post by:
Hi, I'm doing an asp.net app (first one) and NEED to use frames (so please don't tell me not to!). I'm loading a mainframe.htm with two aspx files (for example: left.aspx, right.asp). QUESTION:...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
2
by: Iwan Adler | last post by:
hi ich have an asp.net application. on the index.aspx page are 2 iframes. these iframes contain a src to another aspx page from my application. the index page is cached from the iis, also the...
10
by: stathisgotsis | last post by:
Hello everyone, I am having a brain fart or something, why won't this work? test.php: <?php session_start(); $_SESSION='test'; header("Location: test2.php"); exit();
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.