Writeout session data to disk before redirecting. Suggestion from Thomas.