Rails 2.3.14 setting expire_after for sessions is ignored
- by Sergii Shablatovych
I have next config in my environment.rb:
config.action_controller.session_store = :cookie_store
config.action_controller.session = {
:expire_after => 14.days,
:domain => DOMAIN,
:session_key => '_session',
:secret => 'some_string'
}
Setting session_store to active_record_store or mem_cache_store didn't help.
Also i've tried just setting cookie from controller (with all founded options for expire):
cookies[:test] = { :value => 'test' , :expires => 3600.to_i.from_now.utc }
In both ways all sessions and cookies are deleted after closing browser window - they are only for browser session.
I've tried almost all variants founded in the Internet - no luck(
My config is: Ubuntu 10.04 LTS, rails 2.3.14, ruby Enterprise Edition 1.8.7, Phusion Passenger version 3.0.11 and Nginx compiled by Phusion Passenger.
I've an options that it's Nginx not allowing setting some headers but also didn't find any solution.
Any help appreciated! Thanks
UPD.
i've tried to put all configs for sessions to config/initializers/session_store.rb - nothing changed.
i have a feeling that it's not a rails problem. may it be phusion + nginx error?
i don't even know how to check where the problem is.