473,320 Members | 2,158 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,320 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 3160
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Agent M | last post by:
Hi there New to PHP. Im trying to set a cookie but for some reason it wont work. The code is inside a Submit button and happens after I have read the MySQL database and succesfully retrieved the...
18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
1
by: Display Name | last post by:
Used one of these canned scripts to set up a JS quiz but not before having used another canned PHP script for "Tell your friend about this Web page!" sort of thing. Now i've gotta integrate them;...
5
by: Connie Walsh | last post by:
Hi: I gleaned a javascript off of the web: http://www.hypergurl.com/popup.html that sets a cookie everytime someone visits your site. If it is the first visit in x number of days then a...
2
by: rn5a | last post by:
A web.config file has the following code: <configuration> <system.web> <authentication mode="Forms"> <forms name="NETConnectCookie" loginUrl="Login.aspx"> <credentials passwordFormat="SHA1"/>...
2
by: marc | last post by:
Can you somehow make a new cookie in javascript code and then use that cookie in a new http session using Window.Open? It does not seem to be one of the parameters. I could open the window as...
2
by: Brajendrabraj | last post by:
how can I get user name which come from cookie in differrent window of IE if I already logged in that perticular site for example: i login in site and get username from cookie and display it on...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.