def set_seen_cookie(event):
    """Add a ``has_been_seen_before`` cookie (that lasts for six weeks) to all
      HTML responses.
      
          >>> from mock import Mock
          >>> mock_event = Mock()
      
      Ignores non HTML responses::
      
          >>> mock_event.response.content_type = 'foo'
          >>> set_seen_cookie(mock_event)
          >>> mock_event.response.set_cookie.called
          False
      
      Sets a ``has_been_seen_before`` cookie::
      
          >>> mock_event.response.content_type = 'text/html'
          >>> set_seen_cookie(mock_event)
          >>> mock_event.response.set_cookie.assert_called_with(
          ...         'has_been_seen_before', 'true', max_age=3628800)
      
    """
    if 'html' in event.response.content_type:
        cookie_name = 'has_been_seen_before'
        expires_after = 3628800
        event.response.set_cookie(cookie_name, 'true', max_age=expires_after)
