Ai đó có thể chỉ ra tùy chọn cấu hình phiên Rails 3.x mới là gì?Rails 3 tùy chọn cấu hình phiên bổ sung (khóa, hết hạn_after, an toàn)
Tôi đang cố sao chép cùng một cấu hình mà tôi có trong ứng dụng Rails 2.3.x của mình.
Đây là cấu hình mà tôi sử dụng trong các ứng dụng:
#environment.rb
config.action_controller.session_store = :active_record_store
config.action_controller.session = {
:key => '_something', #non-secure for development
:secret => 'really long random string'
}
# production.rb - override environment.rb for production
config.action_controller.session = {
:key => '_something_secure',
:secret => 'really long random string',
:expire_after => 60*60,#time in seconds
:secure => true #The session will now not be sent or received on HTTP requests.
}
Tuy nhiên, trong Rails 3.x, tôi chỉ có thể tìm thấy đề cập đến các nội dung sau:
AppName::Application.config.session_store :active_record_store
AppName::Application.config.secret_token = 'really long random string'
AppName::Application.config.cookie_secret = 'another really long random string'
Có cấu hình khác cài đặt để kiểm soát khóa, expire_after thời gian và tùy chọn bảo mật?
Về sau, nếu "config.force_ssl = true" được đặt trong production.rb, tôi cho rằng tùy chọn bảo mật không còn cần thiết nữa?
Cảm ơn rất nhiều!
Hạn sử dụng: http://stackoverflow.com/questions/5860950/setting-session-timeout-in-rails-3 –
an toàn: http://stackoverflow.com/ câu hỏi/72242/how-do-i-set-the-httponly-flag-on-cookie-in-ray –