/    Sign up×
Community /Pin to ProfileBookmark

sessions and frames

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 ?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@olafDec 09.2003 — why should that be a problem?

maybe you can define your problem a little bit more
Copy linkTweet thisAlerts:
@mityaauthorDec 09.2003 — 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.
Copy linkTweet thisAlerts:
@ZibingsDec 09.2003 — 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!
Copy linkTweet thisAlerts:
@mityaauthorDec 09.2003 — 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.
Copy linkTweet thisAlerts:
@olafDec 09.2003 — [i]Originally posted by mitya [/i]

[B]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. [/B]
[/QUOTE]


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.
Copy linkTweet thisAlerts:
@mityaauthorDec 09.2003 — 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.
Copy linkTweet thisAlerts:
@ZibingsDec 09.2003 — Best of luck.
×

Success!

Help @mitya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...