ruby - Rails 3 cookies won't stay permanent -


i've upgraded rails 3.0.7 (from rails 2) , i've found cookies no longer working. before able set expiration date , well. i'm aware of new cookies.permanent way of doing things doesn't seem work either (and understanding old way should work anyways).

here's code, it's straight forward:

cookies[:remember_me_id] = { :value => user.id.to_s, :expires => 365.days.from_now } cookies[:remember_me_code] = { :value => digest::sha256.hexdigest(user.cookie_code), :expires => 365.days.from_now } 

just 100% clear, i've tried well:

cookies.permanent[:remember_me_id] = user.id.to_s cookies.permanent[:remember_me_code] = digest:sha256.hexdigest(user.cookie_code) 

the cookies created problem set expire when browser closes. i've checked in firefox , ie. in firefox when go view cookie says expiration when browser closes. not want @ all.

is there simple i'm missing here? new rails 3 setting must put in place make cookies persist?

i've been experiencing same issue, when developing webrick in ms windows environment: rails 3.0.5, ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32].

i find cookie expiry works expected when executing same code on webrick running in usual linux environment: rails 3.0.5, ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]). both methods outlined above (setting :expires explicitly or using "permanent" accessor), appear work on linux box.

because issue appears isolated windows environment didn't search exhaustively resolution... cursory search revealed no answer. have had further luck issue?

are developing on windows , switching dev environments option you? (not ideal 1 obviously)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -