Updated so that all session urls are encoded