我的配置代码
require 'sinatra'
#set :environment, :production
enable :sessions
enable :logging
set run: true
case
when production?
set port: 8081
when development?
require 'sinatra/reloader'
require 'better_errors'
use BetterErrors::Middleware
BetterErrors.application_root = __dir__
end
use Rack::Session::Cookie, key: 'N&wedhSDF',
domain: "localhost",
path: '/',
expire_after: 14400,
secret: '*&(^B234'
get '/' do
erb :hello
end
它仍然显示警告:
SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
This poses a security threat. It is strongly recommended that you
provide a secret to prevent exploits that may be possible from crafted
cookies. This will not be supported in future versions of Rack, and
future versions will even invalidate your existing user cookies.
但它没有出现在生产中
问题是,为什么即使 Rack::Session::Cookie 已经设置,它仍然显示警告?