Session rewrite