This project is archived and is in readonly mode.
Cookies :expires value WRONG when I18n locale isn't EN
Reported by Gacha | April 15th, 2010 @ 08:13 AM
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
Comments and changes to this ticket
-
Gacha April 15th, 2010 @ 08:37 AM
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")}"
-
Rizwan Reza May 15th, 2010 @ 10:28 AM
- Tag changed from cookies, expires, i18n to bugmash, cookies, expires, i18n
-
Patrik Stenmark May 15th, 2010 @ 11:08 AM
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 doesdef index cookies[:test] = {:value => 1, :expires => 1.day.from_now} end
The result from
curl -i http://localhost:3001/test
isSet-Cookie: test=1; path=/; expires=Sun, 16-May-2010 10:05:04 GMT
-
Rizwan Reza May 15th, 2010 @ 07:38 PM
- Tag changed from bugmash, cookies, expires, i18n to cookies, expires, i18n
- State changed from new to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>