Fix session and redirect.