fixes #5773 - redirect to referrer URL that includes page and search

@domcleal, I appended the `controller_name` the session variable so now there won't be a conflict if a user has two tabs open. I think this is better than saving the referrer url in a hidden field on the form.