Cookie Not Available after window.open

S

Scott

Here is the scenario. I need to launch a popup using window.open, but
can't pass everything i need to pass on the querystring. So I thought
I would set a cookie.

Basically I do:

setCookie('NameList', aReallyLongListOfNames);
window.open(aWindowThatNeedsToReadNameList);

then in the window (on the server side) I try to access the cookie,
but it is not there. What gives? I know that document.cookie has the
NameList before the window.open call.
 
J

Jeff North

On 9 Jul 2004 15:20:00 -0700, in comp.lang.javascript
| Here is the scenario. I need to launch a popup using window.open, but
| can't pass everything i need to pass on the querystring. So I thought
| I would set a cookie.
|
| Basically I do:
|
| setCookie('NameList', aReallyLongListOfNames);
| window.open(aWindowThatNeedsToReadNameList);
|
| then in the window (on the server side) I try to access the cookie,
| but it is not there. What gives? I know that document.cookie has the
| NameList before the window.open call.

You could try using POST to send all of your data to the pop-up
window.
<form name="f1" method="post" .....>

popup would need
<%
v1 = Request.Form("value1")
etc etc etc
%>
Both the GET and POST methods have length limitations (200+ characters
and 4k respectively). Cookies also have a size limit (4k). If your
data is still exceeding this limit then you will have to rethink what
data you are transmitting between pages.
 
S

Scott

Because of the way the popup windows communicates its data back to the
parent, i need to use window.open. How would I do that with a post? I
kicked around the idea of doing a post but I couldn't figure out how
to make it work with window.open.

TIA
Scott Monte
 
J

Jeff North

On 10 Jul 2004 07:04:06 -0700, in comp.lang.javascript
| Because of the way the popup windows communicates its data back to the
| parent, i need to use window.open. How would I do that with a post? I
| kicked around the idea of doing a post but I couldn't figure out how
| to make it work with window.open.

page1.asp
---------
<html>
<head>
<title>Page 1</title>
</head>
<body>
<FORM action="page2.asp" METHOD="post" name="f1" target="_blank"
id="f1" >
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr><td><input name="text1" type="text" value="text1" /></td></tr>
<tr><td><input name="text4" type="text" id="text4" value="text4"
/></td></tr>
<tr><td><input type="submit" name="Submit" value="Submit"
/></td></tr>
</table>
</FORM>
</body>
</html>

page2.asp
---------
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
Response.Write("+++" + Request.Form + "+++" );
%>
<html>
<head>
<title>Page 2</title>
</head>
<body>
</body>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top