• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • 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">
  <noframes>
  <body>

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

  </body>
  </noframes>
</frameset>
0
the_cyman
Asked:
the_cyman
  • 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.

0
 
ZvonkoSystems architectCommented:
0
 
the_cymanAuthor Commented:
Amazing, thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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