473,386 Members | 1,738 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,386 software developers and data experts.

setting advanced cookies with javascript

25
I need to set a ParentCookie wich will include sub childern
Example (in ASP):
response.cookies("testCookie")("test1") = "186"
response.cookies("testCookie")("test2") = "140"

in this way i can pool all the test Cookies by accessing the testCookie
and loop all the children

How can i do it in javascript??
Oct 28 '07 #1
3 2178
Logician
210 100+
I need to set a ParentCookie wich will include sub childern
Example (in ASP):
response.cookies("testCookie")("test1") = "186"
response.cookies("testCookie")("test2") = "140"

in this way i can pool all the test Cookies by accessing the testCookie
and loop all the children

How can i do it in javascript??
A cookie is a string of the form name=value and cannot be placed into a heirachy.
You could create a cookie of the form:
Expand|Select|Wrap|Line Numbers
  1. testCookie="test1=186,test2=140" 
then parse the different values.
Oct 29 '07 #2
obarash
25
I thing it will cause a problem

I'm writing the cookie with javascript but
I read it in asp in the next form

for each test in Request.Cookies("testCookie")

with testCookie="test1=186,test2=140"
I'll need to read all the cookie and split it by "," it is very simple
but i'm trying to avoide of changing 3 different files
Oct 29 '07 #3
obarash
25
Thank you!

I've tried the way you suggested and it works fine with my old asp code.

Thanks
Oct 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John Taylor-Johnston | last post by:
I'm a University academic looking for a proper definition of JavaScript Cookies. http://www.CollegeSherbrooke.qc.ca/languesmodernes/604-HAE_Grammar_Practice/ I'm trying to decipher what...
1
by: Timur Tabi | last post by:
I have an embedded system with a web interface. One of the web pages has a small JavaScript program that, when run on IE6, always displays the message that cookies need to be enabled: if...
1
by: Mike | last post by:
I got the code below from an earlier post but I can't get it to work (I get an error on the "for (i=0; i<a.length; i++)" line) Anyone have code that works for cookies with keys? > Anyone...
4
by: socialism001 | last post by:
I'm trying to store a value in a cookie but its not working. Can anyone see what I might be doing wrong. Thanks, Chris ~~~~~~~~~~~~~~~~~~ <script language="javascript">...
1
by: Jose Olivas | last post by:
I am setting a cookie on a subdomain: http://store1.mydomain.com Then the store takes me to a shopping cart that is at: http://shopping.mydomain.com Somewhere the following code (taken and...
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
2
by: junlia | last post by:
Hi All, I am working on a project that acts as a bridge. It does some checking with post xml data, and then redirects the request to an appropriate page. However, we find that depends on the...
2
by: rjoseph | last post by:
Hi Guys I think I have a really easy one for you. I am currently using the following script to store information in cookies: -------------SCRIPT-------------- <%...
0
by: rjoseph | last post by:
Hi Guys I think I have a really easy one for you. I am currently using the following script to store information in cookies: -------------SCRIPT-------------- <%...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.