setting context to be based on 1) URL and then 2) cookie