Cookies multiple values

Hello.I want to create a cookie with multiple values and call them
individually. How it works?

Might need more information. If you are looking to store multiple
values
(e.g., an array) you could convert it to a string for the value of the
cookie:

cookies[:somename] = some_array.join(":")

some_array = cookies[:somename].split(":")

On Fri, Nov 13, 2009 at 3:51 AM, Cookie Rails <
[email protected]> wrote:

Hello.I want to create a cookie with multiple values and call them
individually. How it works?

Posted via http://www.ruby-forum.com/.


Darian Shimy

I need a cookie because I have store different sessions and use them in
different actions of the controller,

I am trying to create a list of values in a cookie, to avoid creating
more cookies. And then invoke a single value, for example:
Cookies [: evidence] = {: value1 = ‘one’: value2 = ‘2’: value3 = > ‘3’}

and then invoke cookies [: tests: value1]
but this syntax is wrong.

Cookie Rails wrote:

I am trying to create a list of values in a cookie, to avoid creating
more cookies. And then invoke a single value, for example:
cookies [: prove] = {: value1 = ‘one’: value2 = ‘2’: value3 = > ‘3’}

and then invoke cookies [: prove : value1]
but this syntax is wrong.

Again I would just serialize the value.

On Fri, Nov 13, 2009 at 9:06 AM, Cookie Rails <
[email protected]> wrote:


Darian Shimy