Click to See Complete Forum and Search --> : sessions and frames
mitya
12-09-2003, 05:08 AM
I don't have much experience of using PHP with frames, but I do know that I can't seem to pass vars to frame pages by specifying them in the src (e.g. <iframe src="page.php?var=value...
Does this therefore mean sessions and frames are mutual enemies? Or is there a way to stay inside a session despite using a frameset?
Thanks in advance :)
why should that be a problem?
maybe you can define your problem a little bit more
mitya
12-09-2003, 07:07 AM
Basically because I'm new to sessions and I can't quite get my head around the idea of sessions existing in different frames. If I start the sesssion in the frameset, how are the pages inside my iframe going to know they're part of a session?
Maybe this all sounds silly, but like I say, I'm new to sessions and it seems like I've jumped in at the deep end by using them with frames!
Thanks for your help.
Zibings
12-09-2003, 12:38 PM
I'm not 100% sure what your problem is here, but, I think I might be able to help a tiny bit. This all depends on how you're trying to use sessions:
case "session_start()":
If you're using the pre-defined set of functions for using sessions, such as session_name(), session_start(), and the likes, it shouldn't be dependant at all upon frames. As long as you include a session_start() at the beginning of each page, it will pick up the session variables and you should be able to access them.
case "cookies":
This is just like sessions (session_start()) in PHP. At least, in the fact that, as long as you have something referencing them in each page, you won't have any problems.
case "query_line":
I see that your example, you used "<iframe src="page.php?var=value... ". If this means that you're trying to do it this way, then I can see where you might have problems. Like Olaf said though, we'd need a bit more. Could you tell us the context in which this is being used? Maybe if we knew what you were trying to make overall, it'd make more sense.
Not sure if this will help at all, but here goes nonetheless!
mitya
12-09-2003, 01:49 PM
Thanks guys. I'm fine with all this stuff normally, and have used sessions/cookies/querey strings to track visitors before, the frames thing threw me a bit. But the general consensus here seems to be that it shouldn't be an issue so I'll get on with it.
Can't really elaborate on what I'm doing further as it's just as I said. It's actually a web-styled application in an HTA window (which is irrelevant for this post) where I have a frameset and an iframe where the main content loads. Obviously I want the user to be inside one master session, though, so for example if they send an e-mail I can verify they are still logged in and who they say they are.
Thanks again.
Originally posted by mitya
Basically because I'm new to sessions and I can't quite get my head around the idea of sessions existing in different frames. If I start the sesssion in the frameset, how are the pages inside my iframe going to know they're part of a session?
Maybe this all sounds silly, but like I say, I'm new to sessions and it seems like I've jumped in at the deep end by using them with frames!
Thanks for your help.
you have to know that session's are serverside. They doesn't exits inside a frame. The only thing is, this is up to you, which session you will register.
mitya
12-09-2003, 02:07 PM
yeah I realise they're server side (unlike cookies), it was just a bit confusing for me but I'm starting to see why it shouldn't be! Sure I'll be fine :) Thanks.
Zibings
12-09-2003, 03:38 PM
Best of luck.