title: Passing data between blocks using sinatra
body: <p>I'm trying to pass data between blocks using sinatra. For example:</p>
  
  <pre><code>@data = Hash.new
  post "/" do
     @data[:test] = params.fetch("test").to_s
     redirect "/tmp"
  end
  
  get "/tmp" do
     puts @data[:test]
  end
  </code></pre>
  
  <p>However whenever i get to the tmp block @data is nil and throws an error. Why is that?        </p>