Web Development

I have been working with Sinatra and have encountered this nice error:

The warning is being generated by the session middleware included by Sinatra.

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.

The warning is being generated by the session middleware added by Sinatra.

To fix this, you just have to set a session_secret for Sinatra

enable :sessions
set :session_secret, 'This is a secret key'