Closed Thread Icon

Topic awaiting preservation: Frame/IFrame cookie reading Pages that link to <a href="https://ozoneasylum.com/backlink?for=8743" title="Pages that link to Topic awaiting preservation: Frame/IFrame cookie reading" rel="nofollow" >Topic awaiting preservation: Frame/IFrame cookie reading\

 
Author Thread
Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-04-2003 00:36

I've tried to make IFrames read cookies properly, but they are simply not able to. To put it simply, here's what I've tried (IE latest), and an embedded iframe:
Set cookie in parent
Set cookie in iframe
Neither of these had an effect, the iframe did not read from them. Note, if I opened the iframe's contents in a new window, it read the cookies fine.
So then, when it is in an embedded iframe, where does it read cookies from?
My ultimate goal would be to have visitors of my site automatically logged in to the websites they give me info for that are displayed in my iframe. That is, pages load in the iframe, and I set the cookies so they don't have to log in to say 100 different sites, just give me the info and log in to me. Then they can navigate through my iframes, and be logged in everywhere immediately.

~See my name? Understand? That's why.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 07-04-2003 03:19

I'm a little unclear on the concept here but the issue here sounds like you are trying to read cookies between different domains. If you have a page in an iframe set a cookie, only the pages within the domain that set the cookie can read them.

So you can't set cookies for other domains



.:[ Never resist a perfect moment ]:.

Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-04-2003 08:14

I wish it were so... but they don't. Try to open a page, like a forum, in an IFrame, and try to log in. The cookie is set, and if you open the link in a new window, it works, but in the iframe, it can't read from its own cookie. So where/what does it read from actually?

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 07-04-2003 15:11

How are you setting the cookie, with javascript or server side code?

Also, if you want the cookie to be read across the entire domain, set the path to "/".

Although, I'm curious, why would you need to set cookies in a specific frame. Like bitdamaged said, just set the cookie for the domain and you can read it from any page in that domain. If you have issues reading a cookie from a frame try reading it (and setting it) from the top most level frame (the parent of all the other frames) and you shouldn't have any issues.

Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-07-2003 18:12

Now we are getting crazy....
It works in an old IE version I have with no firewall, but it doesn't in a newer IE version with a firewall. No idea. But I'll tell you if there is anything new.

By the by, this DOM browser is one of the most valuabe things I have come across. I suggest you download it and use as a bookmarklet in IE. http://www.twinhelix.com/test/jsobj.zip

Bai bai,
Hub-izer

Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-08-2003 08:23

In case you are interested, btw, this is my site:
http://www.rwcenter.co.nr/

Click on the little button, and resize if you want. Enjoy!

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 07-08-2003 09:46

Don't have a solution for ya, just wanted to say thanx for the link to the DOM-browser!
I've set it up as a scriptlet and its... well impressive and definatley useful!
Thanx!
/Dan

{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-08-2003 20:01

Yep, that's how I figured out how to finish my site. http://www.rwcenter.co.nr/

Now, I have a question about that. I finished it not 10 minutes ago, and I have a little problem. Surf to it, then click 'warbands' in the cetner frame. Then, click the little minimize button. Then click the button again. The content in the main frame disappears, and is replaced by the default content. Is there any way to change that? There is a hack that would work, that would save the new url every time the user reclicks the site, and set that as the new default. But that would require refreshing each page twice, and, if the pages are dynamic (as I expect them to be), it would ruin them too. So, put simply, is there a way to avoid the pages being refreshed when you click the button twice?

The other question I had was about the nav links. When I click a link, it opens it in a new window, even though I use target="top.opener.window.document.mainf" or something similar. Any ideas?

Thanks,
Hub-izer

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 07-09-2003 21:45

Hm,

I see you've tackled the first problem.

But
target="top.opener.window.document.mainf"
sounds to me like a combination of HTML and Javascript.
My guess is that browsers don't understand, and thus ignore your target-property.
You should fill in the name of the frame:
target="contentFrame" for example.

And ouch, are you gonna fix those colors and images? They're hurting my eyes .

Hub-izer
Bipolar (III) Inmate

From: The little green dot at the center of your monitor
Insane since: Jul 2003

posted posted 07-12-2003 03:59

So are there any ideas for:
1. Not making the inner page refresh when restoring it.
2. Making it work or crash gracefully in other/older browsers than IE 5.
3. Getting the current location of an iframe if it is not on my domain.

Any suggestions? Please?
Hub-izer


PS I found a rather simple method for automagickally logging in people to sites, just make an identical form with PHP with the submit value "1", and do something like body onload="document.formname.submit()". And maybe printing "Logging you in"
In fact http://www.rwcenter.co.nr/logintoduel.html
is a working model of that, but with the password deliberately set to a garbage value. Don't want you guys becoming admins on my game.... :P

« BackwardsOnwards »

Show Forum Drop Down Menu