Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Cookies cann't be saved in rails3?

#5828

I put this code in my controller's action

cookies[:name] = {
    :value   => "test" ,
     :expires => 2.hours.from_now
    }

and i found out that the cookies cann't be saved. My browser is IE8 on win7, rails version is 3.0.1。
I test this with rails 2.3.9, and cookies can be saved.
By the way, i found out that in rails 2.3.9 if without passing the :expires key, the cookies cann't be saved yet.
Is there any information about how to set cookies? I googled for a couples of hours, and have no idea now.
Thanks for your help

Reported by inetufo · October 17th, 2010 @ 11:27 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. inetufo
    inetufo

    I have tested this issue under several environments
    1. Windows7 rails3 IE8, cookies can be saved: No
    2. Windows7 rails 2.3.9, cookies can be saved: Yes

    3.WindowsXP rails3 IE6, cookies can be saved: No
    4.WindowsXP rails 2.3.9, cookies can be saved: Yes

    5.Ubuntu 10.04 rails3 Firefox on Ubuntu && IE8 on Windows7, cookies can be saved: Yes
    6.Ubuntu 10.04 rails2.3.9 Firefox on Ubuntu && IE8 on Windows7, cookies can be saved: Yes

    After several testings, i can make a conclusion now.
    When rails3 app is deployed on *nix system the cookies can be saved with IE or Firefox
    When rails3 app is deployed on Windows the cookies cann't be saved with IE or Firefox

    It seems rails3 app deployed on Windows doesn't send cookies to the browsers client
    in the mean while rails 2.3.9 app deployed on Windwos does.
    I think it's a bug of rails3 on Windows.
    This issue has bothered me for a whole day, and really made me a headache...

    October 17th, 2010 @ 03:55 PM

  2. inetufo
    inetufo

    all above the ruby version is ruby 1.8.7, use gem updating everything to the lasted version

    October 17th, 2010 @ 04:09 PM

  3. Ryan Bigg
    Ryan Bigg
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 19th, 2010 @ 08:22 AM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:29 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:29 PM

  6. kumojima