471,338 Members | 932 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Cookie Not Available after window.open

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.
Jul 23 '05 #1
3 2807
On 9 Jul 2004 15:20:00 -0700, in comp.lang.javascript
sc********@hotmail.com (Scott) wrote:
| 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.
Jul 23 '05 #2
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

Jeff North <jn****@yourpantsbigpond.net.au> wrote in message news:<m9********************************@4ax.com>. ..
On 9 Jul 2004 15:20:00 -0700, in comp.lang.javascript
sc********@hotmail.com (Scott) wrote:
| 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.

Jul 23 '05 #3
On 10 Jul 2004 07:04:06 -0700, in comp.lang.javascript
sc********@hotmail.com (Scott) wrote:
| 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>
</html>

| TIA
| Scott Monte
|
| Jeff North <jn****@yourpantsbigpond.net.au> wrote in message news:<m9********************************@4ax.com>. ..
| > On 9 Jul 2004 15:20:00 -0700, in comp.lang.javascript
| > sc********@hotmail.com (Scott) wrote:
| >
| > >| 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.


Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Agent M | last post: by
1 post views Thread by Display Name | last post: by
5 posts views Thread by Connie Walsh | last post: by
2 posts views Thread by rn5a | last post: by
2 posts views Thread by marc | last post: by

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.