# Cookies question

**URL:** <https://www.ruby-forum.com/t/cookies-question/106114>\
**Category:** Rails\
**Created:** [June 6, 2007, 3:48pm UTC](https://www.ruby-forum.com/t/cookies-question/106114 "2007-06-06T15:48:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [June 6, 2007, 3:48pm UTC](https://www.ruby-forum.com/t/cookies-question/106114/1 "2007-06-06T15:48:22Z")

</div>

Hello all,

I had some problems with setting and getting array from cookie in  
controller. I concluded that cookies[] would get just a first value if a  
cookie is array, while request.cookies[] would get whole array:

cookies[:arr\_cookie] [1,2]  
cookies[:arr\_cookie] #1  
request.cookies[:arr\_cookie] = #[1,2]

Is this normal behaviour and if it is, can anyone explain what are  
reasons for that (performance?, simplicity?)

best regards,  
Bojan

–  
Bojan M.  
 → Ruby on Rails and Web D. Blog : [http://source.mihelac.org](http://source.mihelac.org)
