473,224 Members | 1,401 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,224 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 3141
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.