473,888 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ph p" 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=".$p assword."
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=$sida rray[5];
$sk= $sidarray[6];
$voice= $sidarray[7];
$usevoice= $sidarray[8];
$password= $sidarray[9];
?>
Mar 26 '07 #1
1 2783
"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.ph p" 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=".$p assword."
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=$sida rray[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
8554
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 "Thankyou, $name (where $session(name) = $name etc - not got code available atm, so thats not exactly right, but you get the gist...) I use <body onLoad parent.leftframe etc to reload the left frame, which
4
1997
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 client's site is visited by Netscape 4.x/6.x and IE-5.x/6.x. It's being converted to ASP and currently using frames (middle frame has a vert scroll bar). -I tried using Session("xxx") but in Netscape (4.x), it opens up a new Session-ID for each...
0
1642
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 does something like: Response.cookies("ID") = RS.fields("UserID").value Response.cookies("USERNAME") = RS.fields("Username").value Response.cookies("LEVEL") = RS.fields("ULevel").value and from there, I have a header include that will...
3
2105
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 created. Is there any way that cookie can be issed , some way to go arround frames restrictions. Thanks for your help. Marcin Gorzynski marcin@apartmentsapart.com
1
1702
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 cookies that are available in all frames, so I know that the frames are capable of reading cookies, just not the ones that I set in the other frame. P.S. I am not setting any expiration, path, or domain... keeping the defaults.
20
3383
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 there seems to be the thought of why use Frames when you can use a Master Page? How does a Master Page only update a section without re-displaying the entire page. We have a site that has some small swf banners for lack of a better term that we...
5
1762
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 rather than the one I've navigated to. If you go to this page: http://fboprimedevel.e3ft.com
14
1593
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 I certainly don't want to put the music on each page. But, the page is not treated well by google as it has no descriptive text to index so I would like to change it to a first real page with text, but I don't want to lose the advantage of a...
27
3983
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 that didn't support the framed version. I wonder whether newer browsers have fixed that problem, and I can now use frames without fear? Regards, Murray R. Van Luyn.
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10887
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9597
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7148
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5824
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4247
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.