redirect after login to "next" login param

After login, in thanks page, redirect user to "next" get param that was sent to login
about removing the if, if I remove if there I have to add it in the session assign above, since it's always assigning there.
So it shouldn't assign if GET "next" is not there; or the session.get.next_url will be the actual next url or None; but the key will never be empty.