473,424 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 software developers and data experts.

frames and cookies

I have a page, which writes a cookie, creating two frames. I have verified
via Fireplug that the cookie is being written. In one of the frames, an
attempt then is made to read the cookie. Therein, I have code to see if the
cookie is set -- and it keeps telling me it is not set (despite my being
able to see it there, and it;s contents, and it is correct). Can someone
please tell me why, in this code, my frame connot read this cookie? Thanks.

//here is the page that creates the cookie, and establishes the frames
-------------------------------
<?php
$user= $_POST['user'];
$server= $_POST['server'];
$port= $_POST['port'];
$channel= $_POST['channel'];
$email= $_POST['email'];
$fullname= $_POST['fullname'];
$sk= $_POST['sk'];
$voice= $_POST['voice'];
$usevoice= $_POST['usevoice'];
$password= $_POST['password'];
$timer = md5(time());
$info = $user . "+" . $server . "+" . $port. "+" . $channel. "+"
..$email. "+" .$fullname. "+" .$sk. "+" .$voice. "+" .$usevoice. "+"
..$password;
SetCookie("vios", $info, time() + 86400 * 10); //Set Cookie for 10
days
?>
<HTML>
<HEAD>
<TITLE>VIOS Demonstration</TITLE>
</HEAD>

<frameset rows="320,*">
<!--<frame src="ggadmintop.html" name="main" marginwidth="1"
marginheight="1"-->
<frame src="viostop.php" name="top" scrolling="no" noresize
FRAMEBORDER="0" BORDER="0" FRAMESPACING="0" marginwidth="1"
marginheight="1">
<?php
echo "<frame
src=\"http://127.0.0.1:2001?userid=".$user."&password=".$passwo rd."
name=\"bottom\" marginwidth=\"1\" scrolling=\"no\" noresize
FRAMEBORDER=\"0\" BORDER=\"0\" FRAMESPACING=\"0\" marginheight=\"1\">";
?>
<noframes>
<body>
<p>
<p>This web page uses frames, but your
browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</HTML>
-------------------------------------------------------------
//and here is the frame that attempts to then read the cookie:

<html>
<head>
</head>
<body>
<?php
if (!(isset($vios))) {
echo "cookie not set in browser.";
exit;
}
$sidarray = explode("+", "$vios");
$user= $sidarray[0];
$server= $sidarray[1];
$port= $sidarray[2];
$channel= $sidarray[3];
$email= $sidarray[4];
$fullname=$sidarray[5];
$sk= $sidarray[6];
$voice= $sidarray[7];
$usevoice= $sidarray[8];
$password= $sidarray[9];
?>
Mar 26 '07 #1
1 2742
"R. Vince" <rvince99 a t hotmail d o t comwrote:
I have a page, which writes a cookie, creating two frames. I have verified
via Fireplug that the cookie is being written. In one of the frames, an
attempt then is made to read the cookie. Therein, I have code to see if
the cookie is set -- and it keeps telling me it is not set (despite my
being able to see it there, and it;s contents, and it is correct). Can
someone please tell me why, in this code, my frame connot read this
cookie? Thanks.

//here is the page that creates the cookie, and establishes the frames
-------------------------------
<?php
$user= $_POST['user'];
$server= $_POST['server'];
$port= $_POST['port'];
$channel= $_POST['channel'];
$email= $_POST['email'];
$fullname= $_POST['fullname'];
$sk= $_POST['sk'];
$voice= $_POST['voice'];
$usevoice= $_POST['usevoice'];
$password= $_POST['password'];
$timer = md5(time());
$info = $user . "+" . $server . "+" . $port. "+" . $channel. "+"
.$email. "+" .$fullname. "+" .$sk. "+" .$voice. "+" .$usevoice. "+"
.$password;
SetCookie("vios", $info, time() + 86400 * 10); //Set Cookie for 10
days
?>
<HTML>
<HEAD>
<TITLE>VIOS Demonstration</TITLE>
</HEAD>

<frameset rows="320,*">
<!--<frame src="ggadmintop.html" name="main"
marginwidth="1"
marginheight="1"-->
<frame src="viostop.php" name="top" scrolling="no"
noresize
FRAMEBORDER="0" BORDER="0" FRAMESPACING="0" marginwidth="1"
marginheight="1">
<?php
echo "<frame
src=\"http://127.0.0.1:2001?userid=".$user."&password=".$passwo rd."
name=\"bottom\" marginwidth=\"1\" scrolling=\"no\" noresize
FRAMEBORDER=\"0\" BORDER=\"0\" FRAMESPACING=\"0\" marginheight=\"1\">";
?>
<noframes>
<body>
<p>
<p>This web page uses frames, but your
browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</HTML>
-------------------------------------------------------------
//and here is the frame that attempts to then read the cookie:

<html>
<head>
</head>
<body>
<?php
if (!(isset($vios))) {
echo "cookie not set in browser.";
exit;
}
$sidarray = explode("+", "$vios");
$user= $sidarray[0];
$server= $sidarray[1];
$port= $sidarray[2];
$channel= $sidarray[3];
$email= $sidarray[4];
$fullname=$sidarray[5];
$sk= $sidarray[6];
$voice= $sidarray[7];
$usevoice= $sidarray[8];
$password= $sidarray[9];
?>
Hi R. Vince,

Cookies are set PER DOMAIN and possible even with a PATH in that domain.
That means that a cookie set at:
http://www.example.com cannot be retrieved by:
http://www.yetanotherdomain.com

By not retrieving I mean:
1) Is NEVER send to the server
2) Cannot be queried by Javascript.

So in effect a cookie from another domain is effectively not there.
This has been like this since... Netscape2 if memory serves me well.

Regards,
Erwin Moller
Mar 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BWGames | last post by:
Hey all, I have a website, which uses frames (I know, I know...). Left frame is a navbar, with the main content in the right frame. I can login using sessions on the right frame, giving...
4
by: A Web Master | last post by:
I want to know the best way of passing on variable contents on a site coded in ASP using frameset/frame. Content is used in all frames for stuffs like screen_resolution, language, ... My...
0
by: Dan Meehan | last post by:
I created a music website that allows people to sign up and post messages on some message boards and update their profiles and such. The login script uses cookies, so when they Log Into the site it...
3
by: Marcin Gorzynski | last post by:
Hi Our partner is using our page in a frame. That couses a problem because our domain is unable to issue the cookie also session does not work. each time you click in the frame new session is...
1
by: Eric Petzold | last post by:
What's the trick to sharing cookies between frames? I can set and read a cookie in the same frame, but if I try to read the cookie in another frame it is undefined. :o( There are some other...
20
by: M.Siler | last post by:
Let me first by saying I am NOT a .net programmer, but am very skilled with ASP, JavaScript, HTML, DHTML, Flash development. I've been reading through posts here about Frames vs. Master Pages and...
5
by: David T. Ashley | last post by:
Hi, I have an application where I use a left frame to navigate to another page in the main frame. After I've done this, when I use "RELOAD" in the browser, it goes back to the original page...
14
by: bill | last post by:
I currently have a site which has the index page immediately open two frames. I put a music object in the top frame. That way the music is not cut off when the user navigates to another page and...
27
by: Murray R. Van Luyn | last post by:
Hi, Is using frames in a website as big an issue nowadays as it was maybe 5 or so years ago? I can remember that you used to have to have a frame site, as well as a non frame site for browsers...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.