# Problem with set-cookie?

**URL:** <https://discuss.rubyonrails.org/t/problem-with-set-cookie/43275>\
**Category:** rubyonrails-talk\
**Created:** [June 8, 2009, 8:34am UTC](https://discuss.rubyonrails.org/t/problem-with-set-cookie/43275 "2009-06-08T08:34:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [June 8, 2009, 8:34am UTC](https://discuss.rubyonrails.org/t/problem-with-set-cookie/43275/1 "2009-06-08T08:34:59Z")

</div>

Hello everyone,

I'm a beginner in Ruby on Rails and I have a little problem when I update my application RoR in my server. Can you help me please?

My problem is:

When I code my application in my computer: It's ok. When I update my application in my server I have a "bug" with cookies.

When a user come in my website for the first time, I initialize some cookies. But in my server I have a message in my page and the cookies isn't initialize:

Set-Cookie: boite=1-2; path=/ Set-Cookie: \_mileva2\_session\_id=BAh7CDoPc2Vzc2lvbl9pZCIlMzAyYjdlMjNiMzg5MDZlM2I3OTZlYTY4MzZkYjdkMjciCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA6EF9jc3JmX3Rva2VuIjFHTDY3TmcvclhXeXIwTG5YcDlmbzBkOFU1eW1VQkNYNUVhU2d2Qm1DdUIwPQ%3D%3D--2ea57948c303a0b69628eb3b8798eba64ef4dd44; path=/; HttpOnly

It's working perfectly in my computer and I searched the problem in different place but no result ☹

My version of rails is 2.3.2.

A fragment of my code where I initialize the cookies:

In welcome\_controller.rb # 3 # Dans le cas où j'ai ni cookie, et que je suis pas loggué boite = Box.find( :all, :conditions =\> "capsules.admin = '1' && boxes.user\_id = '0'", :order =\> 'position', :group =\> 'capsule\_id', :joins =\> "inner join capsules on boxes.capsule\_id = capsules.id" ) @box = boite

# Pour créer les starters et les closers @number = 8 - boite.length

# Initialisation des cookies cookies[:user] = 'mileva' cookie\_text = "" j = 0 for box in boite if(j \>= 1) cookie\_text = cookie\_text + "-" end cookie\_text = cookie\_text + box.capsule.id.to\_s j = j + 1 end

cookies[:boite] = cookie\_text

You can see the error in www.mileva.eu (Warning, if you don't visit for the first time, you have to clear your cookies)

Thank you and Have fun

Joachim

---

<div class="post-metadata">

**Author:** ![Matt\_Jones](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Matt\_Jones](https://discuss.rubyonrails.org/u/Matt_Jones)\
**Post date:** [June 8, 2009, 4:40pm UTC](https://discuss.rubyonrails.org/t/problem-with-set-cookie/43275/2 "2009-06-08T16:40:12Z")

</div>

Your server is running an old version of Passenger (2.0.6); this is a known issue with that version and Rails 2.3.2. Upgrading to the latest Passenger will fix it.

--Matt Jones
