session array

Results 1 to 2 of 2

Thread: session array

  1. #1
    Join Date
    Dec 1969

    Default session array

    Is it possible to use session arrays in jscript asp? If so, how do I do it.. or is there a good reference out there on the subject.<BR>Thanks,

  2. #2
    Join Date
    Dec 1969

    Default It's tough...

    I presume you have tested it, and it doesn&#039;t work? I never have, but I know that a JS array is not a "safe array" and I *think* that&#039;s the only kind that a Session variable will accept.<BR><BR>So...I don&#039;t think that you can store a JS array in a Session variable. You&#039;d have to store a VBS array and then use the VBArray class in JS to get to it. And, unfortunately, there&#039;s no way to create a VBS array using JS. <BR><BR><BR><BR>Have you considered using the .join method to turn the array into a string and storing the string? If you did something like .join("") then I doubt you&#039;d find that any of the elements in your array had a  (backspace) character in them.<BR><BR>Then you can restore the array in the next page via .split("") on the string you get from the Session variable.<BR><BR>It&#039;s a tiny bit ugly, but if the elements of the JS array are strings, already, at least you won&#039;t be eating up any more memory space (and maybe less).<BR><BR>Of course, if you are using an array-of-arrays, then it gets uglier.<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts