/    Sign up×
Community /Pin to ProfileBookmark

Cookie not recognised in IFRAME

I have set a cookie in an IFRAME using Javascript. This IFRAME, in turn has it’s own child IFRAME, but for some reason the page in this child IFRAME is unable to read the cookie. I set it without expiry, ie:

document.cookie = “cookieName=cookieValue”;

Any thoughts what may be at play and how to go around it?

Thanks in advance…

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@VicauthorOct 02.2005 — To clarify further ... both IFRAMES use pages from the same domain (in fact, the same folder on the server)...
Copy linkTweet thisAlerts:
@tabzterOct 02.2005 — Have you checked to see whether you have cookies enabled on your browser?

If you do then... It sounds as if the child iframe is not updating its cache.Once you set the cookie with the parent frame, reload the child frame and then try to read the cookie value.
×

Success!

Help @Vic 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.27,
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,
)...