By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,448 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,448 IT Pros & Developers. It's quick & easy.

IFRAMES and SessionIDs problems

P: n/a
Check out the following 2 links:
http://www.batisdev.com/admin/test_1images.asp
http://www.batisdev.com/admin/test_2images.asp

First page contain 4 IFRAMES and 1 IMG tags.
Second page contain 4 IFRAMES and 2 IMGs tags.

The problem is that the second IFRAME from the second page
generates fires a new session.

Why?

Dan Popa

Source code for first page:
<code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Response.Buffer= True%>
<html>
<head>
<title>IFRAMES and SessionIDs test (with 1 IMG)</title>
<script language="JavaScript" src="FrameQueue.js"></script>
</head>
<body>
<script>
var frameChain2= new FrameQueue('frameChain2');
function startFrames(){
frameChain2.restart();
}
frameChain2.add("z1", "blank.asp?"+Math.random());
frameChain2.add("z2", "blank.asp?"+Math.random());
frameChain2.add("z3", "blank.asp?"+Math.random());
frameChain2.add("z4", "blank.asp?"+Math.random());
//window.onload = startFrames;
</script>
<%
Response.Write("SessionID:<b>" &
Session.SessionID& "</b><br>")
%>
<style>
IFRAME{width:100%; height:60px; border:1px solid blue}
</style>
This button will load the iframes one after each
other:<button onClick="startFrames()">Load
IFRAMES</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button
onClick="alert(document.cookie)">document.cookie</button>
<iframe id="z1"></iframe><iframe id="z2"></iframe><iframe
id="z3"></iframe><iframe id="z4"></iframe>
<br>
Image 1:<img src="../images/spacer.gif" width="100"
height="40" border="1" alt=""><br>

</body>
</html>
</code>
<b>Source code for the second page:</b>
<code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Response.Buffer= True%>
<html>
<head>
<title>IFRAMES and SessionIDs test (with 2 IMGs)</title>
<script language="JavaScript" src="FrameQueue.js"></script>
</head>

<body>
<script>
var frameChain2= new FrameQueue('frameChain2');
function startFrames(){
frameChain2.restart();
}
frameChain2.add("z1", "blank.asp?"+Math.random());
frameChain2.add("z2", "blank.asp?"+Math.random());
frameChain2.add("z3", "blank.asp?"+Math.random());
frameChain2.add("z4", "blank.asp?"+Math.random());
//window.onload = startFrames;
</script>
<%
Response.Write("SessionID:<b>" &
Session.SessionID& "</b><br>")
%>
<style>
IFRAME{width:100%; height:60px; border:1px solid blue}
</style>
This button will load the iframes one after each
other:<button onClick="startFrames()">Load
IFRAMES</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button
onClick="alert(document.cookie)">document.cookie</button>
<iframe id="z1"></iframe><iframe id="z2"></iframe><iframe
id="z3"></iframe><iframe id="z4"></iframe>
<br>
Image 1:<img src="../images/spacer.gif" width="100"
height="40" border="1" alt=""><br>
Image 2:<img src="../images/adminTemplate_r1_c1.gif"
width="100" height="40" border="1" alt=""><br>

</body>
</html></code>
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.