Displaying 1 result from an estimated 1 matches for "array_for_cooki".
Did you mean:
array_for_cookie
2006 Feb 19
0
Re: can store array or hash in cookies?
Not a bug. A cookie is just a string. You can turn anything into a
string and store it in a cookie. Something very simple like the
following might work for you:
array_for_cookie = [1,4,5,7]
cookies[:foo] = array_for_cookie .to_s
array_from_cookie = cookies[:foo][1..-2].split('','')
(And if you are just storing a single integer in a cookie be sure to
turn it into a string before setting it and then back to an integer
when you read it.)
Lou''s...