Accessing Cookies in Padrino/Sinatra
Unlike in Rails, there is no global cookies
object in Padrino or Sinatra. Instead, you need to use request.cookies
within your request handler:
get :index do
my_value = request.cookies['my_value']
end
Unlike in Rails, there is no global cookies
object in Padrino or Sinatra. Instead, you need to use request.cookies
within your request handler:
get :index do
my_value = request.cookies['my_value']
end