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 :expires value WRONG when I18n locale isn't EN

#4401

Example code:

  cookies[:welcome] = {:value => 1, :expires => 1.day.from_now}
Result when LV locale enabled:
  Set-Cookie: welcome=1; path=/; expires=Pk, 15-apr-2011 06:31:49 GMT
Result when EN locale enabled:
  Set-Cookie: welcome=1; path=/; expires=Fri, 15-Apr-2011 06:31:54 GMT

Some browsers doesn't understand localized time, noticed this on Safari and Chrome.

Rails 2.3.5

Reported by Gacha · April 15th, 2010 @ 08:13 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Gacha
    Gacha

    Working workaround:

      response.headers['Set-Cookie'] = "welcomed=true; path=/; expires=#{I18n.l(1.year.from_now, :locale => :en, :format => "%a, %d-%b-%Y %H:%M:%S GMT")}"
    

    April 15th, 2010 @ 08:37 AM

  2. Rizwan Reza
    Rizwan Reza
    • Tag changed from cookies, expires, i18n to bugmash, cookies, expires, i18n

    May 15th, 2010 @ 10:28 AM

  3. Patrik Stenmark
    Patrik Stenmark

    This is not reproducible for me, both in master and 2.3.5.

    Created a blank app, added the locales for lv, set default locale to :lv (config.i18n.default_locale = :lv), created a controller that does

    def index
      cookies[:test] = {:value => 1, :expires => 1.day.from_now}
    end
    

    The result from curl -i http://localhost:3001/test is

    Set-Cookie: test=1; path=/; expires=Sun, 16-May-2010 10:05:04 GMT
    

    May 15th, 2010 @ 11:08 AM

  4. Anil Wadghule
    Anil Wadghule

    This is not reproducible. I have tested in master branch.

    May 15th, 2010 @ 05:33 PM

  5. pleax
    pleax

    Could not reproduce either.

    May 15th, 2010 @ 06:39 PM

  6. Rizwan Reza
    Rizwan Reza
    • Tag changed from bugmash, cookies, expires, i18n to cookies, expires, i18n
    • State changed from new to invalid

    May 15th, 2010 @ 07:38 PM