More potential cookie fix in redirect

Same as last pull request but with empty path fix.