title: Pyramid: how to set cookie without renderer?
body: <p>In configuration file:</p>
  
  <pre><code>config.add_route('lang', '/lang-{code}')
  </code></pre>
  
  <p>In views:</p>
  
  <pre><code>@view_config(route_name='lang')
  def lang(request):
      code = request.matchdict['code']
      response = Response()
      response.set_cookie('lang', value=code, max_age=31536000) # max_age = year
  
      return HTTPFound(location=request.environ['HTTP_REFERER'])
  </code></pre>
  
  <p>The mechanism is simple: there is a dropped down menu item with languages and clicking on anyone must refresh site with new locale.</p>
  
  <p>Runs without errors, but no cookie set up...
  What I did wrong?</p>
  
  <p>Thanks!</p>