• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Cookies between Frames (same domain)

Hi there,

For some reason:
- I set cookie "username" in frame A using javascript, and frame B get the cookie just fine.
- I set cookie in frame B, but cannot read the cookie in frame A. Why?

Here's the frameset, in case that's important:
<frameset cols="70%,*">
  <frame name="bottom" src="results_frame.htm" scrolling="auto">
  <frame name="middle" target="bottom" src="work_frame.htm">

  <p>This page uses frames, but your browser doesn't support them.</p>

  • 2
1 Solution
ZvonkoSystems architectCommented:
If the two frame sources are different paths and the frame b is in some subfolder then it can read cookies from higher realm folder but cookies from frame b are visible only in subfolders.

To prevent that behavior you have to set ;path=/; for both cookies and then you can read them from any subfolder of the web server root folder.

ZvonkoSystems architectCommented:
the_cymanAuthor Commented:
Amazing, thanks!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now