Refactor session key to support multiple contexts