Urgent help needed in cookie arrays

R

Raghu Raman

Hi,

In javascript file i store 3 values under a single cookie array ,like

var myarray = new Array(null);
myarray["a1"] = "field_1";
myarray["a2"] = "field_2";
myarray["a3"] = "field_3";
document.cookie ="myarray=" + myarray;

it is successfully executed.But i can not retrieve the stored cookie
values in my c#.net code.

***
Could u pls tell me the way i stored the cookie array in javascript is
right?if not pls tell me how.

***If so pls tell me how can i retrieve the stroed values in my c#.net
code.


Thanks & Regards
Raghu
 
G

Guest

Request.Cookies.Get("myarray").Value will give you a comma separated value of
the array values. use the strings split function to get the array back
BTW for this to work u shud use myarray[0] , myarray[1] ... instead on a1,a2
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top